From 6cbafa47b3d14276f65aa4ccae48c5fdfb2fb7bd Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Tue, 11 Apr 2006 18:22:37 +0000 Subject: better error message with target problems --- userspace/ebtables2/ebtables.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'userspace/ebtables2') diff --git a/userspace/ebtables2/ebtables.c b/userspace/ebtables2/ebtables.c index 968c5e7..520d9cf 100644 --- a/userspace/ebtables2/ebtables.c +++ b/userspace/ebtables2/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) { -- cgit v1.2.3