From: Sami Kerola Date: Tue, 24 Apr 2018 20:26:39 +0000 (+0100) Subject: lsmem: add --output-all option X-Git-Tag: v2.33-rc1~274^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcd4bbff87792a4cd917d132814a144078c99f4d;p=thirdparty%2Futil-linux.git lsmem: add --output-all option Signed-off-by: Sami Kerola --- diff --git a/bash-completion/lsmem b/bash-completion/lsmem index 9aa124569d..7d6e842478 100644 --- a/bash-completion/lsmem +++ b/bash-completion/lsmem @@ -40,6 +40,7 @@ _lsmem_module() --bytes --noheadings --output + --output-all --raw --sysroot --summary diff --git a/sys-utils/lsmem.1 b/sys-utils/lsmem.1 index f59c9937cf..4476d3eaf7 100644 --- a/sys-utils/lsmem.1 +++ b/sys-utils/lsmem.1 @@ -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). diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c index 83a393046a..0c7f05dec5 100644 --- a/sys-utils/lsmem.c +++ b/sys-utils/lsmem.c @@ -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 output columns\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" -r, --raw use raw output format\n"), out); fputs(_(" -S, --split split ranges by specified columns\n"), out); fputs(_(" -s, --sysroot 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;