lslogins: add --output-all option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
25d3c40534
commit
2ab432effb
|
@ -59,6 +59,7 @@ _lslogins_module()
|
|||
--noheadings
|
||||
--notruncate
|
||||
--output
|
||||
--output-all
|
||||
--pwd
|
||||
--raw
|
||||
--system-accs
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue