Skip to content

parse-options: allow -h as a short option

René Scharfe git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5parse-options: deduplicate parse_options_usage() callsparse-options.c+12 -60 replies
2/5parse-options: inline parse_options_usage() at its only remaining callerparse-options.c+1 -120 replies
3/5parse-options: allow -h as a short optionparse-options.c parse-options.h+11 -60 replies
4/5grep: stop using PARSE_OPT_NO_INTERNAL_HELPbuiltin/grep.c+1 -160 replies
5/5show-ref: stop using PARSE_OPT_NO_INTERNAL_HELPbuiltin/show-ref.c+1 -111 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] parse-options: allow -h as a short option

The short option -h is hard-wired in parseopt to list the options of a command together with a short explanation. If -h is to be given a different meaning then the flag PARSE_OPT_NO_INTERNAL_HELP has to be specified, which turns off handling for -h, --help and --help-all (except that --help handling is effectively overridden by git.c, but that's a different story).

Most commands that do that, grep and show-ref in particular, still show the usage when -h is specified as the only parameter and with --help-all by implementing explicit handlers for them. This series makes it easier for them by letting them override -h handling without any flag.

Rene Scharfe (5):
parse-options: deduplicate parse_options_usage() calls
parse-options: inline parse_options_usage() at its only remaining caller
parse-options: allow -h as a short option
grep: stop using PARSE_OPT_NO_INTERNAL_HELP
show-ref: stop using PARSE_OPT_NO_INTERNAL_HELP

 builtin/grep.c     | 17 +----------------
 builtin/show-ref.c | 12 +-----------
 parse-options.c    | 40 ++++++++++++++++++++--------------------
 parse-options.h    |  2 +-
 4 files changed, 23 insertions(+), 48 deletions(-)
Signature · 1 line
2.6.3