From dd52c4fa011d5fe5c4cd82908ec5fee18843b06e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 6 Mar 2020 16:26:06 +0100 Subject: [PATCH] lsirq: add -n option Signed-off-by: Karel Zak --- sys-utils/lsirq.1 | 5 ++++- sys-utils/lsirq.c | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys-utils/lsirq.1 b/sys-utils/lsirq.1 index 4050643741..7e9117d327 100644 --- a/sys-utils/lsirq.1 +++ b/sys-utils/lsirq.1 @@ -12,6 +12,9 @@ you should avoid using default outputs in your scripts. Always explicitly define expected columns by using \fB\-\-output\fR. .SH OPTIONS .TP +.BR \-n , " \-\-noheadings +Don't print headings. +.TP .BR \-o , " \-\-output " \fIlist\fP 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. @@ -21,7 +24,7 @@ Specify sort criteria by column name. See \fB\-\-help\fR output to get column names. .TP .BR \-J , " \-\-json -Update interrupt output every +Use JSON output format. .TP .BR \-V ", " \-\-version Display version information and exit. diff --git a/sys-utils/lsirq.c b/sys-utils/lsirq.c index 7853af0eee..35e726cd17 100644 --- a/sys-utils/lsirq.c +++ b/sys-utils/lsirq.c @@ -60,6 +60,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(USAGE_OPTIONS, stdout); fputs(_(" -J, --json use JSON output format\n"), stdout); + fputs(_(" -n, --noheadings don't print headings\n"), stdout); fputs(_(" -o, --output define which output columns to use\n"), stdout); fputs(_(" -s, --sort specify sort column\n"), stdout); fputs(USAGE_SEPARATOR, stdout); @@ -79,6 +80,7 @@ int main(int argc, char **argv) }; static const struct option longopts[] = { {"sort", required_argument, NULL, 's'}, + {"noheadings", no_argument, NULL, 'n'}, {"output", required_argument, NULL, 'o'}, {"json", no_argument, NULL, 'J'}, {"help", no_argument, NULL, 'h'}, @@ -90,11 +92,14 @@ int main(int argc, char **argv) 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) { case 'J': out.json = 1; break; + case 'n': + out.no_headings = 1; + break; case 'o': outarg = optarg; break; -- 2.39.5