Jan Engelhardt | f89c171 | 2009-06-12 20:48:52 +0200 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <xtables.h> |
| 3 | #include "xshared.h" |
| 4 | |
| 5 | /* |
| 6 | * Print out any special helps. A user might like to be able to add a --help |
| 7 | * to the commandline, and see expected results. So we call help for all |
| 8 | * specified matches and targets. |
| 9 | */ |
| 10 | void print_extension_helps(const struct xtables_target *t, |
| 11 | const struct xtables_rule_match *m) |
| 12 | { |
| 13 | for (; t != NULL; t = t->next) { |
| 14 | if (t->used) { |
| 15 | printf("\n"); |
| 16 | if (t->help == NULL) |
| 17 | printf("%s does not take any options\n", |
| 18 | t->name); |
| 19 | else |
| 20 | t->help(); |
| 21 | } |
| 22 | } |
| 23 | for (; m != NULL; m = m->next) { |
| 24 | printf("\n"); |
| 25 | if (m->match->help == NULL) |
| 26 | printf("%s does not take any options\n", |
| 27 | m->match->name); |
| 28 | else |
| 29 | m->match->help(); |
| 30 | } |
| 31 | } |