From 5ad0d3d5266b83aa767a7efa09cb574d3c2968b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Tue, 17 Nov 2015 11:25:38 +0100 Subject: parse-options: allow -h as a short option Let callers provide their own handler for the short option -h even without the flag PARSE_OPT_NO_INTERNAL_HELP, but call the internal handler (showing usage information) if that is the only parameter. Implement the first part by checking for -h only if parse_short_opt() can't find it and returns -2. Signed-off-by: Rene Scharfe Signed-off-by: Jeff King --- parse-options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse-options.h') diff --git a/parse-options.h b/parse-options.h index e8b55ea87..ea4af92a5 100644 --- a/parse-options.h +++ b/parse-options.h @@ -199,7 +199,7 @@ enum { struct parse_opt_ctx_t { const char **argv; const char **out; - int argc, cpidx; + int argc, cpidx, total; const char *opt; int flags; const char *prefix; -- cgit v1.2.1