Re: [RFC PATCH v2 02/13] walken: add usage to enable -h
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 27, 2019, 04:47 UTC
- Message-ID
- <CAPig+cQxt7rZRkQLpUZabwfLfWpzvVrWNd11RkQvt83K8zPZ7w@mail.gmail.com>
- In-Reply-To
- <20190626235032.177551-3-emilyshaffer@google.com>
On Wed, Jun 26, 2019 at 7:51 PM Emily Shaffer <emilyshaffer@google.com> wrote:
Show 14 quoted lines
> It's expected that Git commands support '-h' in order to provide a
> consistent user experience (and this expectation is enforced by the
> test suite). '-h' is captured by parse_options() by default; in order to
> support this flag, we add a short usage text to walken.c and invoke
> parse_options().
> [...]
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
> diff --git a/builtin/walken.c b/builtin/walken.c
> @@ -5,9 +5,34 @@
> +const char * const walken_usage[] = {
> + N_("git walken"),
> + NULL,
> +};Unless you expect to reference this from multiple functions, there is no need for it to reside here; instead, it can live inside cmd_walken(). (And, if you do leave it in the global scope for some reason, it should be 'static'.)
Show 5 quoted lines
> int cmd_walken(int argc, const char **argv, const char *prefix)
> {
> + struct option options[] = {
> + OPT_END()
> + };