From: "René Scharfe" <l.s.r@web.de>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: [PATCH 0/5] parse-options: allow -h as a short option
Date: Tue, 17 Nov 2015 11:19:30 +0100 [thread overview]
Message-ID: <564AFF32.1030406@web.de> (raw)
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
next reply other threads:[~2015-11-17 10:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 10:19 René Scharfe [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564AFF32.1030406@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).