summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bash-completion/lsmem1
-rw-r--r--sys-utils/lsmem.13
-rw-r--r--sys-utils/lsmem.c9
3 files changed, 12 insertions, 1 deletions
diff --git a/bash-completion/lsmem b/bash-completion/lsmem
index 9aa124569..7d6e84247 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 f59c9937c..4476d3eaf 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<code>).
diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c
index 83a393046..0c7f05dec 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 <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;