summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2010-11-24 20:36:30 +0100
committerSven Verdoolaege <skimo@kotnet.org>2010-11-24 20:36:32 +0100
commit748344d7e5ad424d08e4d3cf98dced7e07e596fd (patch)
tree136910db4966817d08b0938d6074f14676d67020
parent3a69d95d6f92d661d6635fe0ad967f1a2b768a02 (diff)
downloadisl-748344d7e5ad424d08e4d3cf98dced7e07e596fd.tar.gz
isl-748344d7e5ad424d08e4d3cf98dced7e07e596fd.tar.bz2
isl-748344d7e5ad424d08e4d3cf98dced7e07e596fd.zip
isl_arg_parse: delimit string option argument by angle brackets
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r--isl_arg.c9
1 files 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");
}