summaryrefslogtreecommitdiffstats
path: root/src/bmon.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2014-05-08 15:16:38 +0200
committerThomas Graf <tgraf@suug.ch>2014-05-08 15:16:38 +0200
commit46ec101b00e1e1a791bb8b587a5c0907c41fd601 (patch)
treeb6d74429c0828dd0194a8c5613c68d3434e8e48f /src/bmon.c
parent127ffda0157ea3c60f7dec181de5d6b6d74b1312 (diff)
Add -b / --use-bit option to display rates in bit/s instead of bytes/s
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'src/bmon.c')
-rw-r--r--src/bmon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bmon.c b/src/bmon.c
index 22492d0..93f1c9b 100644
--- a/src/bmon.c
+++ b/src/bmon.c
@@ -59,6 +59,7 @@ static char *usage_text =
"\n" \
"Output:\n" \
" -U, --use-si Use SI units\n" \
+" -b, --use-bit Display in bits instead of btyes\n" \
"\n" \
"Module configuration:\n" \
" modparm := MODULE:optlist,MODULE:optlist,...\n" \
@@ -170,7 +171,7 @@ static int parse_args_post(int argc, char *argv[])
for (;;)
{
- char *gostr = "i:o:p:r:R:s:aU" \
+ char *gostr = "i:o:p:r:R:s:aUb" \
"L:hvVf:";
struct option long_opts[] = {
@@ -182,6 +183,7 @@ static int parse_args_post(int argc, char *argv[])
{"sleep-interval", 1, 0, 's'},
{"show-all", 0, 0, 'a'},
{"use-si", 0, 0, 'U'},
+ {"use-bit", 0, 0, 'b'},
{"lifetime", 1, 0, 'L'},
{0, 0, 0, 0},
};
@@ -225,6 +227,10 @@ static int parse_args_post(int argc, char *argv[])
cfg_setbool(cfg, "use_si", cfg_true);
break;
+ case 'b':
+ cfg_setbool(cfg, "use_bit", cfg_true);
+ break;
+
case 'L':
cfg_setint(cfg, "lifetime", strtoul(optarg, NULL, 0));
break;