summaryrefslogtreecommitdiff
path: root/ifpps.c
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 /ifpps.c
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>
Diffstat (limited to 'ifpps.c')
-rw-r--r--ifpps.c10
1 files changed, 5 insertions, 5 deletions
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"