diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-02-07 03:45:26 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-02-07 04:09:27 +0100 |
commit | 58b491f8cb5b4a0315037d0e1f61f8162a556e8a (patch) | |
tree | 05d6ccf56011d087fd36b12a43f63671f81efd83 /iptables.c | |
parent | 17e310b2610448605567644f667c79f41d76f51e (diff) |
iptables: fix error message for unknown options
-From: iptables v1.4.10: option "-q" requires an argument
+To: iptables v1.4.10: unknown option "-q"
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables.c')
-rw-r--r-- | iptables.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -1316,15 +1316,12 @@ static void command_default(struct iptables_command_state *cs) return; } - if (cs->c == '?') { - if (optopt) - xtables_error(PARAMETER_PROBLEM, - "option \"%s\" requires an argument", - cs->argv[optind-1]); - else - xtables_error(PARAMETER_PROBLEM, - "unknown option \"%s\"", cs->argv[optind-1]); - } + if (cs->c == ':') + xtables_error(PARAMETER_PROBLEM, "option \"%s\" " + "requires an argument", cs->argv[optind-1]); + if (cs->c == '?') + xtables_error(PARAMETER_PROBLEM, "unknown option " + "\"%s\"", cs->argv[optind-1]); xtables_error(PARAMETER_PROBLEM, "Unknown arg \"%s\"", optarg); } @@ -1426,7 +1423,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle opts = xt_params->orig_opts; while ((cs.c = getopt_long(argc, argv, - "-A:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:fbvnt:m:xc:g:", + "-:A:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:fbvnt:m:xc:g:", opts, NULL)) != -1) { switch (cs.c) { /* |