summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-07-12 11:37:27 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-07-12 11:40:50 +0200
commitdd123b0fb6af4909aa30940a8dc34661e8b1c420 (patch)
tree9340b3338f5851572665dadbdabe6066f9f6410d
parentaffa51801095f861aa4d86b67097f1616f653492 (diff)
ifpps: Consistently list command line options
Instead of (more or less) arbitrarily listing the command line options, sort them according to the following rule: - options with required argument, alphabetically by short option - options without argument, alphabetically by short option - common options -v/--version and -h/--help Do this in the short options string, the long options struct, the in-program usage and the man page. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--ifpps.810
-rw-r--r--ifpps.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/ifpps.8 b/ifpps.8
index c151899..60a9385 100644
--- a/ifpps.8
+++ b/ifpps.8
@@ -52,15 +52,12 @@ facilitates creation of gnuplot figures from ifpps time series.
.SS -d <netdev>, --dev <netdev>
Networking device to fetch statistics from, for example eth0, wlan0.
.PP
-.SS -t <time>, --interval <time>
-Statistics refresh interval in milliseconds, default is 1000ms.
-.PP
.SS -n, --num-cpus
Set maximum number of top hitter CPUs (in terms of time spent in system/user
mode) to display in ncurses mode, default is 10.
.PP
-.SS -p, --promisc
-Turn on promiscuous mode for the given networking device.
+.SS -t <time>, --interval <time>
+Statistics refresh interval in milliseconds, default is 1000ms.
.PP
.SS -c, --csv
Output (once) the ncurses data to the terminal as gnuplot(1)-ready data.
@@ -75,6 +72,9 @@ processed later with gnuplot(1).
Show median values across all CPUs for CPU load, interrupts (per interval and
absolute) and software interrupts.
.PP
+.SS -p, --promisc
+Turn on promiscuous mode for the given networking device.
+.PP
.SS -W, --no-warn
Suppress possible warnings in the ncurses output, e.g. about a too low sampling
interval that could cause performance regression.
diff --git a/ifpps.c b/ifpps.c
index c9b5de3..77dfa6e 100644
--- a/ifpps.c
+++ b/ifpps.c
@@ -76,15 +76,15 @@ static int show_median = 0;
static WINDOW *stats_screen = NULL;
static struct utsname uts;
-static const char *short_options = "d:t:n:vhclpmW";
+static const char *short_options = "d:n:t:clmpWvh";
static const struct option long_options[] = {
{"dev", required_argument, NULL, 'd'},
- {"interval", required_argument, NULL, 't'},
{"num-cpus", required_argument, NULL, 'n'},
- {"promisc", no_argument, NULL, 'p'},
+ {"interval", required_argument, NULL, 't'},
{"csv", no_argument, NULL, 'c'},
{"loop", no_argument, NULL, 'l'},
{"median", no_argument, NULL, 'm'},
+ {"promisc", no_argument, NULL, 'p'},
{"no-warn", no_argument, NULL, 'W'},
{"version", no_argument, NULL, 'v'},
{"help", no_argument, NULL, 'h'},
@@ -116,13 +116,13 @@ static void __noreturn help(void)
"Usage: ifpps [options] || ifpps <netdev>\n"
"Options:\n"
" -d|--dev <netdev> Device to fetch statistics for e.g., eth0\n"
- " -t|--interval <time> Refresh time in ms (default 1000 ms)\n"
" -n|--num-cpus <num> Number of top hitter CPUs to display\n"
" in ncurses mode (default 5)\n"
- " -p|--promisc Promiscuous mode\n"
+ " -t|--interval <time> Refresh time in ms (default 1000 ms)\n"
" -c|--csv Output to terminal as Gnuplot-ready data\n"
" -l|--loop Continuous CSV output\n"
" -m|--median Display median values\n"
+ " -p|--promisc Promiscuous mode\n"
" -W|--no-warn Suppress warnings\n"
" -v|--version Print version and exit\n"
" -h|--help Print this help and exit\n\n"