summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2015-11-17 10:25:38 (GMT)
committerJeff King <peff@peff.net>2015-11-20 13:02:07 (GMT)
commit5ad0d3d5266b83aa767a7efa09cb574d3c2968b3 (patch)
tree005a6e86ca2eec0b0f3d158ef9884a512730fdb8 /parse-options.h
parentd3d1f8c46f9ff69de1b4d48d4e194b006ae17a90 (diff)
downloadgit-5ad0d3d5266b83aa767a7efa09cb574d3c2968b3.zip
git-5ad0d3d5266b83aa767a7efa09cb574d3c2968b3.tar.gz
git-5ad0d3d5266b83aa767a7efa09cb574d3c2968b3.tar.bz2
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 <l.s.r@web.de> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse-options.h b/parse-options.h
index e8b55ea..ea4af92 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;