]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsns: add --output-all option
authorSami Kerola <kerolasa@iki.fi>
Tue, 24 Apr 2018 20:27:04 +0000 (21:27 +0100)
committerSami Kerola <kerolasa@iki.fi>
Thu, 3 May 2018 18:56:21 +0000 (19:56 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/lsns
sys-utils/lsns.8
sys-utils/lsns.c

index 035f43b2a1961a18be3ae6c9e63169b73d763b2f..8964606cb5739bd56fc0a4b666d2f60ea1663528 100644 (file)
@@ -40,6 +40,7 @@ _lsns_module()
                                        --list
                                        --noheadings
                                        --output
+                                       --output-all
                                        --task
                                        --raw
                                        --notruncate
index 90009a780896e2893f6ecd4333138f22ec6484c3..aba37266942515512a37a955729445a443fd4680 100644 (file)
@@ -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
index 7264817a8d26746586bdb2a98321478d729d044b..3050b505dd08f4071a7ffbc05aced9b7554955f9 100644 (file)
@@ -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;