]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsmem: add --output-all option
authorSami Kerola <kerolasa@iki.fi>
Tue, 24 Apr 2018 20:26:39 +0000 (21:26 +0100)
committerSami Kerola <kerolasa@iki.fi>
Thu, 3 May 2018 18:56:20 +0000 (19:56 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/lsmem
sys-utils/lsmem.1
sys-utils/lsmem.c

index 9aa124569d531f5adf831b2daef1b9f485898251..7d6e8424785195f93023e8c4dd7465eb4919505d 100644 (file)
@@ -40,6 +40,7 @@ _lsmem_module()
                --bytes
                --noheadings
                --output
+               --output-all
                --raw
                --sysroot
                --summary
index f59c9937cf590244c78eb5ddd7ac014c28a2da13..4476d3eaf7269bc21c47485b02c6cc600753b9c6 100644 (file)
@@ -57,6 +57,9 @@ to get a list of all supported columns.
 The default list of columns may be extended if \fIlist\fP is
 specified in the format \fB+\fIlist\fP (e.g. \fBlsmem \-o +NODE\fP).
 .TP
+.B \-\-output\-all
+Output all available columns.
+.TP
 .BR \-P , " \-\-pairs"
 Produce output in the form of key="value" pairs.
 All potentially unsafe characters are hex-escaped (\\x<code>).
index 83a393046a37f6c2f9b5de744b0272a1d9b29cd0..0c7f05dec51a2a128e23409943ac3ca865a73b63 100644 (file)
@@ -498,6 +498,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -b, --bytes          print SIZE in bytes rather than in human readable format\n"), out);
        fputs(_(" -n, --noheadings     don't print headings\n"), out);
        fputs(_(" -o, --output <list>  output columns\n"), out);
+       fputs(_("     --output-all     output all columns\n"), out);
        fputs(_(" -r, --raw            use raw output format\n"), out);
        fputs(_(" -S, --split <list>   split ranges by specified columns\n"), out);
        fputs(_(" -s, --sysroot <dir>  use the specified directory as system root\n"), out);
@@ -527,7 +528,8 @@ int main(int argc, char **argv)
        size_t i;
 
        enum {
-               LSMEM_OPT_SUMARRY = CHAR_MAX + 1
+               LSMEM_OPT_SUMARRY = CHAR_MAX + 1,
+               OPT_OUTPUT_ALL
        };
 
        static const struct option longopts[] = {
@@ -537,6 +539,7 @@ int main(int argc, char **argv)
                {"json",        no_argument,            NULL, 'J'},
                {"noheadings",  no_argument,            NULL, 'n'},
                {"output",      required_argument,      NULL, 'o'},
+               {"output-all",  no_argument,            NULL, OPT_OUTPUT_ALL},
                {"pairs",       no_argument,            NULL, 'P'},
                {"raw",         no_argument,            NULL, 'r'},
                {"sysroot",     required_argument,      NULL, 's'},
@@ -581,6 +584,10 @@ int main(int argc, char **argv)
                case 'o':
                        outarg = optarg;
                        break;
+               case OPT_OUTPUT_ALL:
+                       for (ncolumns = 0; (size_t)ncolumns < ARRAY_SIZE(coldescs); ncolumns++)
+                               columns[ncolumns] = ncolumns;
+                       break;
                case 'P':
                        lsmem->export = 1;
                        lsmem->want_summary = 0;