parse-options: allow -h as a short option
authorRené Scharfe <l.s.r@web.de>
Tue, 17 Nov 2015 10:25:38 +0000 (11:25 +0100)
committerJeff King <peff@peff.net>
Fri, 20 Nov 2015 13:02:07 +0000 (08:02 -0500)
commit5ad0d3d5266b83aa767a7efa09cb574d3c2968b3
tree005a6e86ca2eec0b0f3d158ef9884a512730fdb8
parentd3d1f8c46f9ff69de1b4d48d4e194b006ae17a90
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>
parse-options.c
parse-options.h