git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] parse-options: allow -h as a short option
@ 2015-11-17 10:19 René Scharfe
  2015-11-17 10:25 ` [PATCH 1/5] parse-options: deduplicate parse_options_usage() calls René Scharfe
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: René Scharfe @ 2015-11-17 10:19 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano, Jeff King, Jonathan Nieder

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(-)

-- 
2.6.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-04 18:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17 10:19 [PATCH 0/5] parse-options: allow -h as a short option René Scharfe
2015-11-17 10:25 ` [PATCH 1/5] parse-options: deduplicate parse_options_usage() calls René Scharfe
2015-11-17 10:25 ` [PATCH 2/5] parse-options: inline parse_options_usage() at its only remaining caller René Scharfe
2015-11-17 10:25 ` [PATCH 3/5] parse-options: allow -h as a short option René Scharfe
2015-11-17 10:25 ` [PATCH 4/5] grep: stop using PARSE_OPT_NO_INTERNAL_HELP René Scharfe
2015-11-17 10:26 ` [PATCH 5/5] show-ref: " René Scharfe
2015-12-04 18:40   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).