blob: 21b5b2cb022a58c80991cbd014fe0e0c17c316a7 [file] [log] [blame]
Jan Engelhardtf89c1712009-06-12 20:48:52 +02001#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 */
10void 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}