summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bash-completion/zramctl1
-rw-r--r--sys-utils/zramctl.83
-rw-r--r--sys-utils/zramctl.c11
3 files changed, 14 insertions, 1 deletions
diff --git a/bash-completion/zramctl b/bash-completion/zramctl
index 31e3c76a6..5274a561e 100644
--- a/bash-completion/zramctl
+++ b/bash-completion/zramctl
@@ -41,6 +41,7 @@ _zramctl_module()
--find
--noheadings
--output
+ --output-all
--raw
--reset
--size
diff --git a/sys-utils/zramctl.8 b/sys-utils/zramctl.8
index 679a8a175..ccfb8901d 100644
--- a/sys-utils/zramctl.8
+++ b/sys-utils/zramctl.8
@@ -59,6 +59,9 @@ Define the status output columns to be used. If no output arrangement is
specified, then a default set is used.
Use \fB\-\-help\fP to get a list of all supported columns.
.TP
+.B \-\-output\-all
+Output all available columns.
+.TP
.B \-\-raw
Use the raw format for status output.
.TP
diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c
index 8da7b2ddb..4d900f119 100644
--- a/sys-utils/zramctl.c
+++ b/sys-utils/zramctl.c
@@ -543,6 +543,7 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -f, --find find a free device\n"), out);
fputs(_(" -n, --noheadings don't print headings\n"), out);
fputs(_(" -o, --output <list> columns to use for status output\n"), out);
+ fputs(_(" --output-all output all columns\n"), out);
fputs(_(" --raw use raw status output format\n"), out);
fputs(_(" -r, --reset reset all specified devices\n"), out);
fputs(_(" -s, --size <size> device size\n"), out);
@@ -575,7 +576,10 @@ int main(int argc, char **argv)
int rc = 0, c, find = 0, act = A_NONE;
struct zram *zram = NULL;
- enum { OPT_RAW = CHAR_MAX + 1 };
+ enum {
+ OPT_RAW = CHAR_MAX + 1,
+ OPT_LIST_TYPES
+ };
static const struct option longopts[] = {
{ "algorithm", required_argument, NULL, 'a' },
@@ -583,6 +587,7 @@ int main(int argc, char **argv)
{ "find", no_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
{ "output", required_argument, NULL, 'o' },
+ { "output-all",no_argument, NULL, OPT_LIST_TYPES },
{ "noheadings",no_argument, NULL, 'n' },
{ "reset", no_argument, NULL, 'r' },
{ "raw", no_argument, NULL, OPT_RAW },
@@ -625,6 +630,10 @@ int main(int argc, char **argv)
if (ncolumns < 0)
return EXIT_FAILURE;
break;
+ case OPT_LIST_TYPES:
+ for (ncolumns = 0; (size_t)ncolumns < ARRAY_SIZE(infos); ncolumns++)
+ columns[ncolumns] = ncolumns;
+ break;
case 's':
size = strtosize_or_err(optarg, _("failed to parse size"));
act = A_CREATE;