summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2006-04-11 18:22:37 +0000
committerBart De Schuymer <bdschuym@pandora.be>2006-04-11 18:22:37 +0000
commit1c162af7bc49f487a922edb926cede6c1ecef0ad (patch)
treee2f774a0a2918d46eb3cebc50989a03d58f7d0c7
parentcd51fbe7a3a7b7a79b1964c0a635e1bb0515fb47 (diff)
downloadebtables-1c162af7bc49f487a922edb926cede6c1ecef0ad.tar.gz
ebtables-1c162af7bc49f487a922edb926cede6c1ecef0ad.tar.bz2
ebtables-1c162af7bc49f487a922edb926cede6c1ecef0ad.zip
better error message with target problems
-rw-r--r--ebtables.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ebtables.c b/ebtables.c
index 968c5e7..520d9cf 100644
--- a/ebtables.c
+++ b/ebtables.c
@@ -1073,8 +1073,14 @@ big_iface_length:
if (w->parse(c - w->option_offset, argv, argc, new_entry, &w->flags, &w->w))
break;
- if (w == NULL)
- ebt_print_error2("Unknown argument: '%s', %c, '%c'", argv[optind - 1], (char)optopt, (char)c);
+ if (w == NULL && c == '?')
+ ebt_print_error2("Unknown argument: '%s'", argv[optind - 1], (char)optopt, (char)c);
+ else if (w == NULL) {
+ if (!strcmp(t->name, "standard"))
+ ebt_print_error2("Unknown argument: don't forget the -t option");
+ else
+ ebt_print_error2("Target-specific option does not correspond with specified target");
+ }
if (ebt_errormsg[0] != '\0')
return -1;
if (w->used == 0) {