From e3a0ca878457ecc70d0065802fcb0c6875c6b671 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Thu, 4 Jun 2009 16:43:56 -0700 Subject: parse-options: make OPT_INTEGER's argh explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OPTION_INTEGER hardcodes its argh member to be "n", but the decision is hidden deep in usage_with_options_internal(). Make "n" the default argh for the OPT_INTEGER macro while leaving it undecided for the OPTION_INTEGER enum. This makes it less surprising to users that argh is "n" when using the OPT_INTEGER macro. Signed-off-by: Stephen Boyd Reviewed-by: René Scharfe Signed-off-by: Junio C Hamano --- parse-options.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'parse-options.c') diff --git a/parse-options.c b/parse-options.c index b85cab2466..48ba62b0d8 100644 --- a/parse-options.c +++ b/parse-options.c @@ -503,19 +503,12 @@ int usage_with_options_internal(const char * const *usagestr, switch (opts->type) { case OPTION_ARGUMENT: break; - case OPTION_INTEGER: - if (opts->flags & PARSE_OPT_OPTARG) - if (opts->long_name) - pos += fprintf(stderr, "[=]"); - else - pos += fprintf(stderr, "[]"); - else - pos += fprintf(stderr, " "); - break; case OPTION_CALLBACK: if (opts->flags & PARSE_OPT_NOARG) break; /* FALLTHROUGH */ + case OPTION_INTEGER: + /* FALLTHROUGH */ case OPTION_FILENAME: /* FALLTHROUGH */ case OPTION_STRING: -- cgit v1.2.1