diff options
author | Sami Kerola | 2018-04-23 23:11:47 +0200 |
---|---|---|
committer | Sami Kerola | 2018-05-03 20:56:20 +0200 |
commit | 2ab432effbdba067ae64b134050b192755fa0081 (patch) | |
tree | 8c38ed5d8ef69882811f6f20e6ca6de5461088cc /login-utils | |
parent | lslocks: add --output-all option (diff) | |
download | kernel-qcow2-util-linux-2ab432effbdba067ae64b134050b192755fa0081.tar.gz kernel-qcow2-util-linux-2ab432effbdba067ae64b134050b192755fa0081.tar.xz kernel-qcow2-util-linux-2ab432effbdba067ae64b134050b192755fa0081.zip |
lslogins: add --output-all option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/lslogins.1 | 3 | ||||
-rw-r--r-- | login-utils/lslogins.c | 7 |
2 files changed, 10 insertions, 0 deletions
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[=<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; |