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>
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user