From 748344d7e5ad424d08e4d3cf98dced7e07e596fd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 24 Nov 2010 20:36:30 +0100 Subject: [PATCH] isl_arg_parse: delimit string option argument by angle brackets Signed-off-by: Sven Verdoolaege --- isl_arg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/isl_arg.c b/isl_arg.c index 93785839..056a6d5e 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"); } -- 2.11.4.GIT