From: Phil Sutter Date: Tue, 7 Aug 2018 11:06:39 +0000 (+0200) Subject: xtables: Improve xtables-monitor first impression X-Git-Tag: v1.8.1~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e055aebe63c5d12be8e58e1dc5a5a018c3adf2ac;p=thirdparty%2Fiptables.git 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 --- 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); } }