]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
irqtop: use -J for JSON
authorKarel Zak <kzak@redhat.com>
Wed, 4 Mar 2020 13:58:18 +0000 (14:58 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 4 Mar 2020 13:58:18 +0000 (14:58 +0100)
* add -J to the man page
* add note about default output
* be compatible with another util-linux tools and use -J

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/irqtop.1
sys-utils/irqtop.c

index ebc67549c97f8feb3625aa1744c30db0d3e45e94..42ca91495a03f1a4f7d87f933dbb604ad57f9cc8 100644 (file)
@@ -8,6 +8,10 @@ irqtop \- utility to display kernel interrupt information
 Display kernel interrupt counter information in
 .BR top (1)
 style view.
+.PP
+The default output is subject to change.   So  whenever
+possible,  you should avoid using default outputs in your scripts.  Always explicitly define expected columns 
+by using \fB\-\-columns\fR.
 .SH OPTIONS
 .TP
 .BR \-d ,\  \-\-delay\ \c
@@ -16,6 +20,10 @@ Update interrupt output every
 .I seconds
 intervals.
 .TP
+.BR \-J ,\ \-\-json
+Use JSON output format.  It's strongly recommended to use --columns to keep
+the output stable.
+.TP
 .BR \-o ,\  \-\-once
 Collect interrupt information and output it.  This mode does not use
 ncurses, so the output can easily be redirected to a pipe, file, or such.
index 5bdac92f6a2de451d3fea90ba71bcbe0e5a9eda3..3c12530058870600de961ad80291d3c67ec875c5 100644 (file)
@@ -628,7 +628,7 @@ static void parse_args(struct irqtop_ctl *const ctl, int const argc,
                {"delay", required_argument, NULL, 'd'},
                {"sort", required_argument, NULL, 's'},
                {"once", no_argument, NULL, 'o'},
-               {"json", no_argument, NULL, JSON_OPT},
+               {"json", no_argument, NULL, 'J'},
                {"columns", required_argument, NULL, COLUMNS_OPT},
                {"help", no_argument, NULL, 'h'},
                {"version", no_argument, NULL, 'V'},
@@ -636,7 +636,7 @@ static void parse_args(struct irqtop_ctl *const ctl, int const argc,
        };
        int o;
 
-       while ((o = getopt_long(argc, argv, "d:os:hV", longopts, NULL)) != -1) {
+       while ((o = getopt_long(argc, argv, "d:os:hJV", longopts, NULL)) != -1) {
                switch (o) {
                case 'd':
                        {
@@ -655,7 +655,7 @@ static void parse_args(struct irqtop_ctl *const ctl, int const argc,
                        ctl->run_once = 1;
                        ctl->request_exit = 1;
                        break;
-               case JSON_OPT:
+               case 'J':
                        ctl->json = 1;
                        ctl->run_once = 1;
                        ctl->request_exit = 1;