From: Stephen Boyd <bebarino@gmail•com>
To: Johannes Schindelin <Johannes.Schindelin@gmx•de>
Cc: Geoffrey Irving <irving@naml•us>,
Junio C Hamano <gitster@pobox•com>,
git@vger•kernel.org
Subject: Re: [PATCH] git fast-export: add --no-data option
Date: Mon, 27 Jul 2009 21:11:44 -0700 [thread overview]
Message-ID: <4A6E7A80.9040809@gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0907272042450.6883@intel-tinevez-2-302>
Johannes Schindelin wrote:
> There is an ugly solution:
>
> { OPTION_NEGBIT, 0, "no-data", &no_data, NULL, NULL,
> PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },
> { OPTION_BIT, 0, "no-data", NULL, NULL,
> "Skip output of blob data",
> PARSE_OPT_NOARG, NULL, 1 },
>
> and there is a more elegant solution:
>
> [PATCH] parse-opt: optionally show "--no-" option string
>
> It is usually better to have positive options, to avoid confusing double
> negations. However, sometimes it is desirable to show the negative option
> in the help.
>
> Introduce the flag PARSE_OPT_NEGHELP to do that.
Perhaps with this documentation throw in?
diff --git a/parse-options.h b/parse-options.h
index 90e577d..14162e9 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -81,6 +81,9 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset);
* PARSE_OPT_LITERAL_ARGHELP: says that argh shouldn't be enclosed in brackets
* (i.e. '<argh>') in the help message.
* Useful for options with multiple parameters.
+ * PARSE_OPT_NEGHELP: says that the long option should always be shown with
+ * the --no prefix in the usage message. Sometimes
+ * useful for users of OPTION_NEGBIT.
*
* `callback`::
* pointer to the callback to use for OPTION_CALLBACK.
next prev parent reply other threads:[~2009-07-28 4:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-25 13:45 [PATCH] git fast-export: add --no-data option Geoffrey Irving
2009-07-25 14:28 ` Johannes Schindelin
2009-07-25 17:25 ` Junio C Hamano
2009-07-25 17:44 ` Johannes Schindelin
2009-07-27 12:48 ` Geoffrey Irving
2009-07-27 18:49 ` Johannes Schindelin
2009-07-28 2:20 ` Geoffrey Irving
2009-07-28 4:11 ` Stephen Boyd [this message]
2009-07-28 8:01 ` Johannes Schindelin
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=4A6E7A80.9040809@gmail.com \
--to=bebarino@gmail$(echo .)com \
--cc=Johannes.Schindelin@gmx$(echo .)de \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=irving@naml$(echo .)us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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