From: Sven Verdoolaege Date: Mon, 15 Nov 2010 22:07:24 +0000 (+0100) Subject: isl_arg_parse: always print help option X-Git-Tag: isl-0.05~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43811040ef78e306f72a2eb63596cf7d212026d9;p=platform%2Fupstream%2Fisl.git isl_arg_parse: always print help option Signed-off-by: Sven Verdoolaege --- diff --git a/isl_arg.c b/isl_arg.c index fa45358..5f1950f 100644 --- a/isl_arg.c +++ b/isl_arg.c @@ -14,6 +14,11 @@ #include #include +static struct isl_arg help_arg[] = { +ISL_ARG_PHANTOM_BOOL('h', "help", NULL, "print this help, then exit") +ISL_ARG_END +}; + static void set_default_choice(struct isl_arg *arg, void *opt) { *(unsigned *)(((char *)opt) + arg->offset) = arg->u.choice.default_value; @@ -489,10 +494,10 @@ static void print_help_and_exit(struct isl_arg *arg, const char *prog) printf("\n\n"); print_help(arg, NULL); - if (any_version(arg)) { - printf("\n"); + printf("\n"); + if (any_version(arg)) printf(" -V, --version\n"); - } + print_bool_help(help_arg, NULL); exit(0); }