]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslogins: add --output-all option
authorSami Kerola <kerolasa@iki.fi>
Mon, 23 Apr 2018 21:11:47 +0000 (22:11 +0100)
committerSami Kerola <kerolasa@iki.fi>
Thu, 3 May 2018 18:56:20 +0000 (19:56 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/lslogins
login-utils/lslogins.1
login-utils/lslogins.c

index 795b5d848358a85a5a271bcf3e0bf43e9b0d0b4a..8651fe9df265c1c0402097531c68dc1e4d8cb1b4 100755 (executable)
@@ -59,6 +59,7 @@ _lslogins_module()
                        --noheadings
                        --notruncate
                        --output
+                       --output-all
                        --pwd
                        --raw
                        --system-accs
index bd6955f8211b296452721184b65283d4756d3c91..b56bd57f089376832536975efebfd98ec5fe565e 100644 (file)
@@ -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
index 51033b01bba4e8a105279a31bc7885fc14019191..727b1d65bb809bf02cf765bbfc6334fb63865db4 100644 (file)
@@ -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[=<list>]    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;