From 00147883de850f909b0c0594fd83a93a002271ac Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 23 Apr 2018 21:02:44 +0100 Subject: findmnt: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/findmnt | 1 + misc-utils/findmnt.8 | 5 +++++ misc-utils/findmnt.c | 12 +++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bash-completion/findmnt b/bash-completion/findmnt index bdfa5de5c..21167ca30 100644 --- a/bash-completion/findmnt +++ b/bash-completion/findmnt @@ -118,6 +118,7 @@ _findmnt_module() --notruncate --options --output + --output-all --pairs --raw --types diff --git a/misc-utils/findmnt.8 b/misc-utils/findmnt.8 index 58dd38625..d76d06e9d 100644 --- a/misc-utils/findmnt.8 +++ b/misc-utils/findmnt.8 @@ -150,6 +150,11 @@ options are not specified. The default list of columns may be extended if \fIlist\fP is specified in the format \fI+list\fP (e.g. \fBfindmnt \-o +PROPAGATION\fP). .TP +.B \-\-output\-all +Output almost all available columns. The columns that require +.B \-\-poll +are not included. +.TP .BR \-P , " \-\-pairs" Use key="value" output format. All potentially unsafe characters are hex-escaped (\\x). .TP diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 4d55cde33..c3365534c 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1227,6 +1227,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -n, --noheadings don't print column headings\n"), out); fputs(_(" -O, --options limit the set of filesystems by mount options\n"), out); fputs(_(" -o, --output the output columns to be shown\n"), out); + fputs(_(" --output-all output all available columns\n"), out); fputs(_(" -P, --pairs use key=\"value\" output format\n"), out); fputs(_(" -R, --submounts print all submounts for the matching filesystems\n"), out); fputs(_(" -r, --raw use raw output format\n"), out); @@ -1272,7 +1273,8 @@ int main(int argc, char *argv[]) enum { FINDMNT_OPT_VERBOSE = CHAR_MAX + 1, - FINDMNT_OPT_TREE + FINDMNT_OPT_TREE, + FINDMNT_OPT_OUTPUT_ALL }; static const struct option longopts[] = { @@ -1296,6 +1298,7 @@ int main(int argc, char *argv[]) { "notruncate", no_argument, NULL, 'u' }, { "options", required_argument, NULL, 'O' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, FINDMNT_OPT_OUTPUT_ALL }, { "poll", optional_argument, NULL, 'p' }, { "pairs", no_argument, NULL, 'P' }, { "raw", no_argument, NULL, 'r' }, @@ -1396,6 +1399,13 @@ int main(int argc, char *argv[]) case 'o': outarg = optarg; break; + case FINDMNT_OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) { + if (is_tabdiff_column(ncolumns)) + continue; + columns[ncolumns] = ncolumns; + } + break; case 'O': set_match(COL_OPTIONS, optarg); break; -- cgit v1.2.3-55-g7522 From 289673b1c02374d4f7ae80bb1dd17aabd37d6b14 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 23 Apr 2018 21:19:35 +0100 Subject: losetup: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/losetup | 1 + sys-utils/losetup.8 | 3 +++ sys-utils/losetup.c | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bash-completion/losetup b/bash-completion/losetup index b58d8de94..d20726533 100644 --- a/bash-completion/losetup +++ b/bash-completion/losetup @@ -63,6 +63,7 @@ _losetup_module() --list --noheadings --output + --output-all --raw --help --version" diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 index cdb9ed052..a7e38f4f4 100644 --- a/sys-utils/losetup.8 +++ b/sys-utils/losetup.8 @@ -145,6 +145,9 @@ print info about all devices. See also \fB\-\-output\fP, \fB\-\-noheadings\fP, Specify the columns that are to be printed for the \fB\-\-list\fP output. Use \fB\-\-help\fR to get a list of all supported columns. .TP +.B \-\-output\-all +Output all available columns. +.TP .BR \-n , " \-\-noheadings" Don't print headings for \fB\-\-list\fP output format. .IP "\fB\-\-raw\fP" diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 7c9145a88..670bce2e3 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -430,6 +430,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -l, --list list info about all or specified (default)\n"), out); fputs(_(" -n, --noheadings don't print headings for --list output\n"), out); fputs(_(" -O, --output specify columns to output for --list\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" --raw use raw --list output format\n"), out); fputs(USAGE_SEPARATOR, out); @@ -590,7 +591,8 @@ int main(int argc, char **argv) OPT_SIZELIMIT = CHAR_MAX + 1, OPT_SHOW, OPT_RAW, - OPT_DIO + OPT_DIO, + OPT_OUTPUT_ALL }; static const struct option longopts[] = { { "all", no_argument, NULL, 'a' }, @@ -607,6 +609,7 @@ int main(int argc, char **argv) { "noheadings", no_argument, NULL, 'n' }, { "offset", required_argument, NULL, 'o' }, { "output", required_argument, NULL, 'O' }, + { "output-all", no_argument, NULL, OPT_OUTPUT_ALL }, { "sizelimit", required_argument, NULL, OPT_SIZELIMIT }, { "partscan", no_argument, NULL, 'P' }, { "read-only", no_argument, NULL, 'r' }, @@ -701,6 +704,10 @@ int main(int argc, char **argv) outarg = optarg; list = 1; break; + case OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) + columns[ncolumns] = ncolumns; + break; case 'P': lo_flags |= LO_FLAGS_PARTSCAN; break; -- cgit v1.2.3-55-g7522 From fbf0619b2bf7d80fc667ecbb6bcd39758b2feb8d Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 23 Apr 2018 21:34:49 +0100 Subject: lscpu: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/lscpu | 1 + sys-utils/lscpu.1 | 4 ++++ sys-utils/lscpu.c | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/bash-completion/lscpu b/bash-completion/lscpu index 69337acef..4d3582fd4 100644 --- a/bash-completion/lscpu +++ b/bash-completion/lscpu @@ -37,6 +37,7 @@ _lscpu_module() --sysroot --hex --physical + --output-all --help --version" COMPREPLY=( $(compgen -W "${OPTS_ALL[*]}" -- $cur) ) diff --git a/sys-utils/lscpu.1 b/sys-utils/lscpu.1 index b70f2e151..fa7a475ba 100644 --- a/sys-utils/lscpu.1 +++ b/sys-utils/lscpu.1 @@ -161,6 +161,10 @@ The CPU logical numbers are not affected by this option. .TP .BR \-V , " \-\-version" Display version information and exit. +.TP +.B \-\-output\-all +Output all available columns. This option must be combined with either +.BR \-\-extended " or " \-\-parse . .SH BUGS The basic overview of CPU family, model, etc. is always based on the first CPU only. diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 2132511a5..f260fe7ca 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -1932,6 +1932,9 @@ int main(int argc, char *argv[]) int columns[ARRAY_SIZE(coldescs)], ncolumns = 0; int cpu_modifier_specified = 0; + enum { + OPT_OUTPUT_ALL = CHAR_MAX + 1, + }; static const struct option longopts[] = { { "all", no_argument, NULL, 'a' }, { "online", no_argument, NULL, 'b' }, @@ -1944,6 +1947,7 @@ int main(int argc, char *argv[]) { "physical", no_argument, NULL, 'y' }, { "hex", no_argument, NULL, 'x' }, { "version", no_argument, NULL, 'V' }, + { "output-all", no_argument, NULL, OPT_OUTPUT_ALL }, { NULL, 0, NULL, 0 } }; @@ -2008,6 +2012,13 @@ int main(int argc, char *argv[]) case 'V': printf(UTIL_LINUX_VERSION); return EXIT_SUCCESS; + case OPT_OUTPUT_ALL: + { + size_t sz; + for (sz = 0; sz < ARRAY_SIZE(coldescs); sz++) + columns[sz] = 1; + break; + } default: errtryhelp(EXIT_FAILURE); } -- cgit v1.2.3-55-g7522 From 25d3c405343f20db5dfcb61334102bcfadc1d5bf Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 23 Apr 2018 22:02:48 +0100 Subject: lslocks: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/lslocks | 1 + misc-utils/lslocks.8 | 3 +++ misc-utils/lslocks.c | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/bash-completion/lslocks b/bash-completion/lslocks index acc7b1ff6..fbe75fffa 100644 --- a/bash-completion/lslocks +++ b/bash-completion/lslocks @@ -36,6 +36,7 @@ _lslocks_module() --noinaccessible --noheadings --output + --output-all --pid --raw --notruncate diff --git a/misc-utils/lslocks.8 b/misc-utils/lslocks.8 index ba0f44752..40b2cebf6 100644 --- a/misc-utils/lslocks.8 +++ b/misc-utils/lslocks.8 @@ -40,6 +40,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 \fI+list\fP (e.g. \fBlslocks -o +BLOCKER\fP). .TP +.B \-\-output\-all +Output all available columns. +.TP .BR \-p , " \-\-pid " \fIpid\fP Display only the locks held by the process with this \fIpid\fR. .TP diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 2427006f6..f83fb76f2 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -536,6 +536,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -i, --noinaccessible ignore locks without read permissions\n"), out); fputs(_(" -n, --noheadings don't print headings\n"), out); fputs(_(" -o, --output define which output columns to use\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" -p, --pid display only locks held by this process\n"), out); fputs(_(" -r, --raw use the raw output format\n"), out); fputs(_(" -u, --notruncate don't truncate text in columns\n"), out); @@ -558,12 +559,16 @@ int main(int argc, char *argv[]) int c, rc = 0; struct list_head locks; char *outarg = NULL; + enum { + OPT_OUTPUT_ALL = CHAR_MAX + 1 + }; static const struct option long_opts[] = { { "bytes", no_argument, NULL, 'b' }, { "json", no_argument, NULL, 'J' }, { "pid", required_argument, NULL, 'p' }, { "help", no_argument, NULL, 'h' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, OPT_OUTPUT_ALL }, { "notruncate", no_argument, NULL, 'u' }, { "version", no_argument, NULL, 'V' }, { "noheadings", no_argument, NULL, 'n' }, @@ -603,6 +608,10 @@ int main(int argc, char *argv[]) case 'o': outarg = optarg; break; + case OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) + columns[ncolumns] = ncolumns; + break; case 'V': printf(UTIL_LINUX_VERSION); return EXIT_SUCCESS; -- cgit v1.2.3-55-g7522 From 2ab432effbdba067ae64b134050b192755fa0081 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 23 Apr 2018 22:11:47 +0100 Subject: lslogins: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/lslogins | 1 + login-utils/lslogins.1 | 3 +++ login-utils/lslogins.c | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/bash-completion/lslogins b/bash-completion/lslogins index 795b5d848..8651fe9df 100755 --- a/bash-completion/lslogins +++ b/bash-completion/lslogins @@ -59,6 +59,7 @@ _lslogins_module() --noheadings --notruncate --output + --output-all --pwd --raw --system-accs diff --git a/login-utils/lslogins.1 b/login-utils/lslogins.1 index bd6955f82..b56bd57f0 100644 --- a/login-utils/lslogins.1 +++ b/login-utils/lslogins.1 @@ -67,6 +67,9 @@ Don't truncate output. .TP \fB\-o\fR, \fB\-\-output \fIlist\fP Specify which output columns to print. Use +.TP +.B \-\-output\-all +Output all available columns. .B \-\-help to get a list of all supported columns. .TP diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c index 51033b01b..727b1d65b 100644 --- a/login-utils/lslogins.c +++ b/login-utils/lslogins.c @@ -1241,6 +1241,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" --noheadings don't print headings\n"), out); fputs(_(" --notruncate don't truncate output\n"), out); fputs(_(" -o, --output[=] define the columns to output\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" -p, --pwd display information related to login by password.\n"), out); fputs(_(" -r, --raw display in raw mode\n"), out); fputs(_(" -s, --system-accs display system accounts\n"), out); @@ -1277,6 +1278,7 @@ int main(int argc, char *argv[]) OPT_NOTRUNC, OPT_NOHEAD, OPT_TIME_FMT, + OPT_OUTPUT_ALL, }; static const struct option longopts[] = { @@ -1292,6 +1294,7 @@ int main(int argc, char *argv[]) { "notruncate", no_argument, 0, OPT_NOTRUNC }, { "noheadings", no_argument, 0, OPT_NOHEAD }, { "output", required_argument, 0, 'o' }, + { "output-all", no_argument, 0, OPT_OUTPUT_ALL }, { "last", no_argument, 0, 'L', }, { "raw", no_argument, 0, 'r' }, { "system-accs", no_argument, 0, 's' }, @@ -1385,6 +1388,10 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; opt_o = 1; break; + case OPT_OUTPUT_ALL: + for (ncolumns = 0; (size_t)ncolumns < ARRAY_SIZE(coldescs); ncolumns++) + columns[ncolumns] = ncolumns; + break; case 'r': outmode = OUT_RAW; break; -- cgit v1.2.3-55-g7522 From fcd4bbff87792a4cd917d132814a144078c99f4d Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 21:26:39 +0100 Subject: lsmem: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/lsmem | 1 + sys-utils/lsmem.1 | 3 +++ sys-utils/lsmem.c | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) 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). 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 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; -- cgit v1.2.3-55-g7522 From 1f7b62e0b277a54b2f1e90fafdd11cc37bc74d23 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 21:27:04 +0100 Subject: lsns: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/lsns | 1 + sys-utils/lsns.8 | 3 +++ sys-utils/lsns.c | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/bash-completion/lsns b/bash-completion/lsns index 035f43b2a..8964606cb 100644 --- a/bash-completion/lsns +++ b/bash-completion/lsns @@ -40,6 +40,7 @@ _lsns_module() --list --noheadings --output + --output-all --task --raw --notruncate diff --git a/sys-utils/lsns.8 b/sys-utils/lsns.8 index 90009a780..aba372669 100644 --- a/sys-utils/lsns.8 +++ b/sys-utils/lsns.8 @@ -51,6 +51,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. \fBlsns \-o +PATH\fP). .TP +.B \-\-output\-all +Output all available columns. +.TP .BR \-p , " \-\-task " \fIpid\fP Display only the namespaces held by the process with this \fIpid\fR. .TP diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index 7264817a8..3050b505d 100644 --- a/sys-utils/lsns.c +++ b/sys-utils/lsns.c @@ -906,6 +906,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -l, --list use list format output\n"), out); fputs(_(" -n, --noheadings don't print headings\n"), out); fputs(_(" -o, --output define which output columns to use\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" -p, --task print process namespaces\n"), out); fputs(_(" -r, --raw use the raw output format\n"), out); fputs(_(" -u, --notruncate don't truncate text in columns\n"), out); @@ -931,11 +932,15 @@ int main(int argc, char *argv[]) int c; int r = 0; char *outarg = NULL; + enum { + OPT_OUTPUT_ALL = CHAR_MAX + 1 + }; static const struct option long_opts[] = { { "json", no_argument, NULL, 'J' }, { "task", required_argument, NULL, 'p' }, { "help", no_argument, NULL, 'h' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, OPT_OUTPUT_ALL }, { "notruncate", no_argument, NULL, 'u' }, { "version", no_argument, NULL, 'V' }, { "noheadings", no_argument, NULL, 'n' }, @@ -980,6 +985,10 @@ int main(int argc, char *argv[]) case 'o': outarg = optarg; break; + case OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) + columns[ncolumns] = ncolumns; + break; case 'V': printf(UTIL_LINUX_VERSION); return EXIT_SUCCESS; -- cgit v1.2.3-55-g7522 From ba1c9075f4525ef27bcfe98dfeca95b749276a9e Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 21:32:42 +0100 Subject: partx: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/partx | 1 + disk-utils/partx.8 | 3 +++ disk-utils/partx.c | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bash-completion/partx b/bash-completion/partx index 2368336ed..028146b0f 100644 --- a/bash-completion/partx +++ b/bash-completion/partx @@ -45,6 +45,7 @@ _partx_module() --noheadings --nr --output + --output-all --pairs --raw --sector-size diff --git a/disk-utils/partx.8 b/disk-utils/partx.8 index af7313cb9..7794f41c9 100644 --- a/disk-utils/partx.8 +++ b/disk-utils/partx.8 @@ -106,6 +106,9 @@ or .B \-\-list options. .TP +.B \-\-output\-all +Output all available columns. +.TP .BR \-P , " \-\-pairs" List the partitions using the KEY="value" format. .TP diff --git a/disk-utils/partx.c b/disk-utils/partx.c index 43a6448db..3ccd1afad 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -765,6 +765,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -g, --noheadings don't print headings for --show\n"), out); fputs(_(" -n, --nr specify the range of partitions (e.g. --nr 2:4)\n"), out); fputs(_(" -o, --output define which output columns to use\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" -P, --pairs use key=\"value\" output format\n"), out); fputs(_(" -r, --raw use raw output format\n"), out); fputs(_(" -S, --sector-size overwrite sector size\n"), out); @@ -796,7 +797,8 @@ int main(int argc, char **argv) unsigned int sector_size = 0; enum { - OPT_LIST_TYPES = CHAR_MAX + 1 + OPT_LIST_TYPES = CHAR_MAX + 1, + OPT_OUTPUT_ALL }; static const struct option long_opts[] = { { "bytes", no_argument, NULL, 'b' }, @@ -811,6 +813,7 @@ int main(int argc, char **argv) { "list-types", no_argument, NULL, OPT_LIST_TYPES }, { "nr", required_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, OPT_OUTPUT_ALL }, { "pairs", no_argument, NULL, 'P' }, { "sector-size",required_argument, NULL, 'S' }, { "help", no_argument, NULL, 'h' }, @@ -858,6 +861,10 @@ int main(int argc, char **argv) case 'o': outarg = optarg; break; + case OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) + columns[ncolumns] = ncolumns; + break; case 'P': scols_flags |= PARTX_EXPORT; what = ACT_SHOW; -- cgit v1.2.3-55-g7522 From 4dfd172dd8e42d060023440cfe5af9ab42b14464 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 21:47:26 +0100 Subject: rfkill: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/rfkill | 1 + sys-utils/rfkill.8 | 3 +++ sys-utils/rfkill.c | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bash-completion/rfkill b/bash-completion/rfkill index 2d561e955..4643666e2 100644 --- a/bash-completion/rfkill +++ b/bash-completion/rfkill @@ -36,6 +36,7 @@ _rfkill_module() --json --noheadings --output + --output-all --raw --help --version diff --git a/sys-utils/rfkill.8 b/sys-utils/rfkill.8 index 3c30c8ced..9eff913b8 100644 --- a/sys-utils/rfkill.8 +++ b/sys-utils/rfkill.8 @@ -34,6 +34,9 @@ Do not print a header line. Specify which output columns to print. Use \-\-help to get a list of available columns. .TP +.B \-\-output\-all +Output all available columns. +.TP \fB\-r\fR, \fB\-\-raw\fR Use the raw output format. .TP diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c index 57e1dddab..d87815a25 100644 --- a/sys-utils/rfkill.c +++ b/sys-utils/rfkill.c @@ -579,6 +579,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -J, --json use JSON output format\n"), stdout); fputs(_(" -n, --noheadings don't print headings\n"), stdout); fputs(_(" -o, --output define which output columns to use\n"), stdout); + fputs(_(" --output-all output all columns\n"), stdout); fputs(_(" -r, --raw use the raw output format\n"), stdout); fputs(USAGE_SEPARATOR, stdout); @@ -609,12 +610,16 @@ static void __attribute__((__noreturn__)) usage(void) int main(int argc, char **argv) { struct control ctrl = { 0 }; - int c, act = ACT_LIST; + int c, act = ACT_LIST, list_all = 0; char *outarg = NULL; + enum { + OPT_LIST_TYPES = CHAR_MAX + 1 + }; static const struct option longopts[] = { { "json", no_argument, NULL, 'J' }, { "noheadings", no_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, OPT_LIST_TYPES }, { "raw", no_argument, NULL, 'r' }, { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, @@ -644,6 +649,9 @@ int main(int argc, char **argv) case 'o': outarg = optarg; break; + case OPT_LIST_TYPES: + list_all = 1; + break; case 'r': ctrl.raw = 1; break; @@ -690,6 +698,8 @@ int main(int argc, char **argv) columns[ncolumns++] = COL_ID; columns[ncolumns++] = COL_TYPE; columns[ncolumns++] = COL_DEVICE; + if (list_all) + columns[ncolumns++] = COL_DESC; columns[ncolumns++] = COL_SOFT; columns[ncolumns++] = COL_HARD; -- cgit v1.2.3-55-g7522 From b5b43f276e3ca7556ddf66f2d95cac8169af4355 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 21:59:23 +0100 Subject: swapon: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/swapon | 1 + sys-utils/swapon.8 | 3 +++ sys-utils/swapon.c | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bash-completion/swapon b/bash-completion/swapon index 4a53ec5ac..f5136efd3 100644 --- a/bash-completion/swapon +++ b/bash-completion/swapon @@ -50,6 +50,7 @@ _swapon_module() --priority --summary --show + --output-all --noheadings --raw --bytes diff --git a/sys-utils/swapon.8 b/sys-utils/swapon.8 index 3c66c8188..b8fc8be71 100644 --- a/sys-utils/swapon.8 +++ b/sys-utils/swapon.8 @@ -160,6 +160,9 @@ Display a definable table of swap areas. See the .B \-\-help output for a list of available columns. .TP +.B \-\-output\-all +Output all available columns. +.TP .B \-\-noheadings Do not print headings when displaying .B \-\-show diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 757601ae6..4ef2f1c9d 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -846,7 +846,8 @@ int main(int argc, char *argv[]) BYTES_OPTION = CHAR_MAX + 1, NOHEADINGS_OPTION, RAW_OPTION, - SHOW_OPTION + SHOW_OPTION, + OPT_LIST_TYPES }; static const struct option long_opts[] = { @@ -861,6 +862,7 @@ int main(int argc, char *argv[]) { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'V' }, { "show", optional_argument, NULL, SHOW_OPTION }, + { "output-all", no_argument, NULL, OPT_LIST_TYPES }, { "noheadings", no_argument, NULL, NOHEADINGS_OPTION }, { "raw", no_argument, NULL, RAW_OPTION }, { "bytes", no_argument, NULL, BYTES_OPTION }, @@ -951,6 +953,10 @@ int main(int argc, char *argv[]) } ctl.show = 1; break; + case OPT_LIST_TYPES: + for (ctl.ncolumns = 0; (size_t)ctl.ncolumns < ARRAY_SIZE(infos); ctl.ncolumns++) + ctl.columns[ctl.ncolumns] = ctl.ncolumns; + break; case NOHEADINGS_OPTION: ctl.no_heading = 1; break; -- cgit v1.2.3-55-g7522 From 2e7ccec7bbad60fd01fb7ebed1e9b6373bd6d4cf Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 22:18:54 +0100 Subject: zramctl: add --output-all option Signed-off-by: Sami Kerola --- bash-completion/zramctl | 1 + sys-utils/zramctl.8 | 3 +++ sys-utils/zramctl.c | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) 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 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 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; -- cgit v1.2.3-55-g7522