summaryrefslogtreecommitdiffstats
path: root/sys-utils/zramctl.c
diff options
context:
space:
mode:
authorKarel Zak2018-05-10 12:15:32 +0200
committerKarel Zak2018-05-10 12:15:32 +0200
commitc9fdebcf540147fe3108971fc9c80d505867f711 (patch)
tree41c8567518c27e21cb371af95518a12140778469 /sys-utils/zramctl.c
parentMerge branch 'fixes' of https://github.com/yontalcar/util-linux (diff)
parentzramctl: add --output-all option (diff)
downloadkernel-qcow2-util-linux-c9fdebcf540147fe3108971fc9c80d505867f711.tar.gz
kernel-qcow2-util-linux-c9fdebcf540147fe3108971fc9c80d505867f711.tar.xz
kernel-qcow2-util-linux-c9fdebcf540147fe3108971fc9c80d505867f711.zip
Merge branch 'output-all' of https://github.com/kerolasa/lelux-utiliteetit
* 'output-all' of https://github.com/kerolasa/lelux-utiliteetit: zramctl: add --output-all option swapon: add --output-all option rfkill: add --output-all option partx: add --output-all option lsns: add --output-all option lsmem: add --output-all option lslogins: add --output-all option lslocks: add --output-all option lscpu: add --output-all option losetup: add --output-all option findmnt: add --output-all option
Diffstat (limited to 'sys-utils/zramctl.c')
-rw-r--r--sys-utils/zramctl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c
index bedb0a042..642d88d41 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;