[iptables PATCH] xtables: Improve xtables-monitor first impression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 iptables/xtables-monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
index a43a69af327e0..e7116545f5030 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);
 		}
 	}
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux