From e055aebe63c5d12be8e58e1dc5a5a018c3adf2ac Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 7 Aug 2018 13:06:39 +0200 Subject: 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 Signed-off-by: Florian Westphal --- iptables/xtables-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'iptables/xtables-monitor.c') 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); } } -- cgit v1.2.3