X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tc%2Fm_gact.c;h=9f07851a6dab9e9b03bd4f43f27f9397472c29cf;hb=7132284647c15ca30d942926bc506d6019d3b61c;hp=4bb50410fa9992108025f8e07df44500b3c3176f;hpb=105da95218c9d30375efc43f9edd8ef32998fedb;p=iproute2.git diff --git a/tc/m_gact.c b/tc/m_gact.c index 4bb5041..9f07851 100644 --- a/tc/m_gact.c +++ b/tc/m_gact.c @@ -1,13 +1,13 @@ /* - * m_gact.c generic actions module + * m_gact.c generic actions module * * This program is free software; you can distribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Authors: J Hadi Salim (hadi@cyberus.ca) - * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * */ #include @@ -27,7 +27,7 @@ /* define to turn on probablity stuff */ #ifdef CONFIG_GACT_PROB -static const char *prob_n2a(int p) +static const char *prob_n2a(int p) { if (p == PGACT_NONE) return "none"; @@ -45,22 +45,28 @@ explain(void) #ifdef CONFIG_GACT_PROB fprintf(stderr, "Usage: ... gact [RAND] [INDEX]\n"); fprintf(stderr, - "Where: ACTION := reclassify | drop | continue | pass " - "RAND := random " - "RANDTYPE := netrand | determ" - "VAL : = value not exceeding 10000" - "INDEX := index value used" + "Where: \tACTION := reclassify | drop | continue | pass \n" + "\tRAND := random \n" + "\tRANDTYPE := netrand | determ\n" + "\tVAL : = value not exceeding 10000\n" + "\tINDEX := index value used\n" "\n"); #else fprintf(stderr, "Usage: ... gact [INDEX]\n"); fprintf(stderr, - "Where: ACTION := reclassify | drop | continue | pass " - "INDEX := index value used" - "\n"); + "Where: \tACTION := reclassify | drop | continue | pass \n" + "\tINDEX := index value used\n" + "\n"); #endif } -#define usage() return(-1) + +static void +usage(void) +{ + explain(); + exit(-1); +} int get_act(char ***argv_p) @@ -157,6 +163,8 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struc } argc--; argv++; + } else if (matches(*argv, "help") == 0) { + usage(); } } #endif @@ -171,6 +179,8 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struc argc--; argv++; ok++; + } else if (matches(*argv, "help") == 0) { + usage(); } }