From f89c1716a7743ca6e2e6164d3b64c15b2e285e1e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 12 Jun 2009 20:48:52 +0200 Subject: iptables: allow for help-less extensions This is for extensions that do not take any options, and which subsequently do not offer any help text either. Signed-off-by: Jan Engelhardt --- iptables.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'iptables.c') diff --git a/iptables.c b/iptables.c index cc175767..a229c35b 100644 --- a/iptables.c +++ b/iptables.c @@ -40,6 +40,7 @@ #include #include #include +#include "xshared.h" #ifndef TRUE #define TRUE 1 @@ -248,9 +249,6 @@ exit_tryhelp(int status) static void exit_printhelp(struct xtables_rule_match *matches) { - struct xtables_rule_match *matchp = NULL; - struct xtables_target *t = NULL; - printf("%s v%s\n\n" "Usage: %s -[AD] chain rule-specification [options]\n" " %s -I chain [rulenum] rule-specification [options]\n" @@ -320,19 +318,7 @@ exit_printhelp(struct xtables_rule_match *matches) " --set-counters PKTS BYTES set the counter during insert/append\n" "[!] --version -V print package version.\n"); - /* Print out any special helps. A user might like to be able - to add a --help to the commandline, and see expected - results. So we call help for all specified matches & targets */ - for (t = xtables_targets; t ;t = t->next) { - if (t->used) { - printf("\n"); - t->help(); - } - } - for (matchp = matches; matchp; matchp = matchp->next) { - printf("\n"); - matchp->match->help(); - } + print_extension_helps(xtables_targets, matches); exit(0); } -- cgit v1.2.3