From: Sven Verdoolaege Date: Wed, 24 Nov 2010 19:36:30 +0000 (+0100) Subject: isl_arg_parse: delimit string option argument by angle brackets X-Git-Tag: isl-0.05~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=748344d7e5ad424d08e4d3cf98dced7e07e596fd;p=platform%2Fupstream%2Fisl.git isl_arg_parse: delimit string option argument by angle brackets Signed-off-by: Sven Verdoolaege --- diff --git a/isl_arg.c b/isl_arg.c index 9378583..056a6d5 100644 --- a/isl_arg.c +++ b/isl_arg.c @@ -350,6 +350,12 @@ static void print_bool_help(struct isl_arg *decl, const char *prefix) printf("\n"); } +static int print_argument_name(struct isl_arg *decl, const char *name, int pos) +{ + printf("%c<%s>", decl->long_name ? '=' : ' ', name); + return pos + 3 + strlen(name); +} + static void print_long_help(struct isl_arg *decl, const char *prefix) { int pos; @@ -383,8 +389,7 @@ static void print_str_help(struct isl_arg *decl, const char *prefix) int pos; const char *a = decl->argument_name ? decl->argument_name : "string"; pos = print_arg_help(decl, prefix, 0); - printf("=%s", a); - pos += 1 + strlen(a); + pos = print_argument_name(decl, a, pos); print_help_msg(decl, pos); printf("\n"); }