summaryrefslogtreecommitdiffstats
path: root/sys-utils
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
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')
-rw-r--r--sys-utils/losetup.83
-rw-r--r--sys-utils/losetup.c9
-rw-r--r--sys-utils/lscpu.14
-rw-r--r--sys-utils/lscpu.c11
-rw-r--r--sys-utils/lsmem.13
-rw-r--r--sys-utils/lsmem.c9
-rw-r--r--sys-utils/lsns.83
-rw-r--r--sys-utils/lsns.c9
-rw-r--r--sys-utils/rfkill.83
-rw-r--r--sys-utils/rfkill.c12
-rw-r--r--sys-utils/swapon.83
-rw-r--r--sys-utils/swapon.c8
-rw-r--r--sys-utils/zramctl.83
-rw-r--r--sys-utils/zramctl.c11
14 files changed, 86 insertions, 5 deletions
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 <cols> 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;
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 fd6d63bbf..619a7df1d 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1935,6 +1935,9 @@ int main(int argc, char *argv[])
int cpu_modifier_specified = 0;
size_t setsize;
+ enum {
+ OPT_OUTPUT_ALL = CHAR_MAX + 1,
+ };
static const struct option longopts[] = {
{ "all", no_argument, NULL, 'a' },
{ "online", no_argument, NULL, 'b' },
@@ -1947,6 +1950,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 }
};
@@ -2011,6 +2015,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);
}
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;
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 <list> define which output columns to use\n"), out);
+ fputs(_(" --output-all output all columns\n"), out);
fputs(_(" -p, --task <pid> 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;
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 <list> 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;
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;
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 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;