diff options
author | Phil Sutter <phil@nwl.cc> | 2018-08-07 13:06:39 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-08-09 21:48:53 +0200 |
commit | e055aebe63c5d12be8e58e1dc5a5a018c3adf2ac (patch) | |
tree | 1c9207a3c2847885e9122baa2b12285aa3bdffb0 /iptables/xtables-monitor.c | |
parent | b92573303260736b0f9be9c1a9442ddec7fdcab2 (diff) |
xtables: Improve xtables-monitor first impression
First time users are likely to call 'xtables-monitor --help' to see
what's going on. Make this situation a bit more pleasant for them:
* When complaining about illegal arguments, add a final newline
character to the error message.
* Actually support '--help' long option as an alias to '-h'.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xtables-monitor.c')
-rw-r--r-- | iptables/xtables-monitor.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c index 035bc9f2..3b1ca777 100644 --- a/iptables/xtables-monitor.c +++ b/iptables/xtables-monitor.c @@ -568,6 +568,7 @@ static const struct option options[] = { {.name = "ipv4", .has_arg = false, .val = '4'}, {.name = "ipv6", .has_arg = false, .val = '6'}, {.name = "version", .has_arg = false, .val = 'V'}, + {.name = "help", .has_arg = false, .val = 'h'}, {NULL}, }; @@ -635,7 +636,7 @@ int xtables_monitor_main(int argc, char *argv[]) exit(0); default: fprintf(stderr, "xtables-monitor %s: Bad argument.\n", IPTABLES_VERSION); - fprintf(stderr, "Try `xtables-monitor -h' for more information."); + fprintf(stderr, "Try `xtables-monitor -h' for more information.\n"); exit(PARAMETER_PROBLEM); } } |