diff options
author | Florian Westphal <fw@strlen.de> | 2018-07-04 12:35:22 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-07-04 12:35:22 +0200 |
commit | f7fec51277e4172d7d05db60e29b4c6cc9746c90 (patch) | |
tree | 68f4a87d2a1825ee521027b63378befbf6bb7792 | |
parent | b470b8e8d8b66834d34f879f5fd316c49dd98303 (diff) |
xtables-monitor: add --version option
... for consistency with other commands.
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | iptables/xtables-monitor.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c index e0a2d98f..08292a79 100644 --- a/iptables/xtables-monitor.c +++ b/iptables/xtables-monitor.c @@ -575,6 +575,7 @@ static const struct option options[] = { {.name = "event", .has_arg = false, .val = 'e'}, {.name = "ipv4", .has_arg = false, .val = '4'}, {.name = "ipv6", .has_arg = false, .val = '6'}, + {.name = "version", .has_arg = false, .val = 'V'}, {NULL}, }; @@ -618,7 +619,7 @@ int xtables_monitor_main(int argc, char *argv[]) memset(&cb_arg, 0, sizeof(cb_arg)); opterr = 0; - while ((c = getopt_long(argc, argv, "ceht46", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "ceht46V", options, NULL)) != -1) { switch (c) { case 'c': counters = true; @@ -638,8 +639,11 @@ int xtables_monitor_main(int argc, char *argv[]) case '6': cb_arg.nfproto = NFPROTO_IPV6; break; + case 'V': + printf("xtables-monitor %s\n", IPTABLES_VERSION); + exit(0); default: - fprintf(stderr, "xtables-monitor %s: Bad argument.\n", XTABLES_VERSION); + fprintf(stderr, "xtables-monitor %s: Bad argument.\n", IPTABLES_VERSION); fprintf(stderr, "Try `xtables-monitor -h' for more information."); exit(PARAMETER_PROBLEM); } |