lsirq: add -n option
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
a0f62b0b20
commit
dd52c4fa01
2 changed files with 10 additions and 2 deletions
|
@ -12,6 +12,9 @@ you should avoid using default outputs in your scripts. Always
|
||||||
explicitly define expected columns by using \fB\-\-output\fR.
|
explicitly define expected columns by using \fB\-\-output\fR.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
|
.BR \-n , " \-\-noheadings
|
||||||
|
Don't print headings.
|
||||||
|
.TP
|
||||||
.BR \-o , " \-\-output " \fIlist\fP
|
.BR \-o , " \-\-output " \fIlist\fP
|
||||||
Specify which output columns to print. Use \fB\-\-help\fR to get a list of all supported columns.
|
Specify which output columns to print. Use \fB\-\-help\fR to get a list of all supported columns.
|
||||||
The default list of columns may be extended if list is specified in the format +list.
|
The default list of columns may be extended if list is specified in the format +list.
|
||||||
|
@ -21,7 +24,7 @@ Specify sort criteria by column name. See \fB\-\-help\fR output to get column
|
||||||
names.
|
names.
|
||||||
.TP
|
.TP
|
||||||
.BR \-J , " \-\-json
|
.BR \-J , " \-\-json
|
||||||
Update interrupt output every
|
Use JSON output format.
|
||||||
.TP
|
.TP
|
||||||
.BR \-V ", " \-\-version
|
.BR \-V ", " \-\-version
|
||||||
Display version information and exit.
|
Display version information and exit.
|
||||||
|
|
|
@ -60,6 +60,7 @@ static void __attribute__((__noreturn__)) usage(void)
|
||||||
|
|
||||||
fputs(USAGE_OPTIONS, stdout);
|
fputs(USAGE_OPTIONS, stdout);
|
||||||
fputs(_(" -J, --json use JSON output format\n"), stdout);
|
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(_(" -o, --output <list> define which output columns to use\n"), stdout);
|
||||||
fputs(_(" -s, --sort <column> specify sort column\n"), stdout);
|
fputs(_(" -s, --sort <column> specify sort column\n"), stdout);
|
||||||
fputs(USAGE_SEPARATOR, stdout);
|
fputs(USAGE_SEPARATOR, stdout);
|
||||||
|
@ -79,6 +80,7 @@ int main(int argc, char **argv)
|
||||||
};
|
};
|
||||||
static const struct option longopts[] = {
|
static const struct option longopts[] = {
|
||||||
{"sort", required_argument, NULL, 's'},
|
{"sort", required_argument, NULL, 's'},
|
||||||
|
{"noheadings", no_argument, NULL, 'n'},
|
||||||
{"output", required_argument, NULL, 'o'},
|
{"output", required_argument, NULL, 'o'},
|
||||||
{"json", no_argument, NULL, 'J'},
|
{"json", no_argument, NULL, 'J'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
|
@ -90,11 +92,14 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "o:s:hJV", longopts, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "no:s:hJV", longopts, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'J':
|
case 'J':
|
||||||
out.json = 1;
|
out.json = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'n':
|
||||||
|
out.no_headings = 1;
|
||||||
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
outarg = optarg;
|
outarg = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue