* [PATCH] update-index: allow "-h" to also display options
@ 2013-02-23 18:10 Antoine Pelisse
2013-02-23 18:13 ` Antoine Pelisse
0 siblings, 1 reply; 3+ messages in thread
From: Antoine Pelisse @ 2013-02-23 18:10 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
Currently, when running "git update-index -h", you only have usage
displayed, but no options. That is not consistent with the behavior of
other commands. It also means that the only way to display options is to
use an unknown argument (or use the man page).
Display usage with options when "git update-index -h" is invoked.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
builtin/update-index.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index ada1dff..3071ee6 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
};
if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(update_index_usage[0]);
+ usage_with_options(&update_index_usage[0], options);
git_config(git_default_config, NULL);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] update-index: allow "-h" to also display options
2013-02-23 18:10 [PATCH] update-index: allow "-h" to also display options Antoine Pelisse
@ 2013-02-23 18:13 ` Antoine Pelisse
2013-02-23 21:25 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Antoine Pelisse @ 2013-02-23 18:13 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
> diff --git a/builtin/update-index.c b/builtin/update-index.c
> index ada1dff..3071ee6 100644
> --- a/builtin/update-index.c
> +++ b/builtin/update-index.c
> @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
> };
>
> if (argc == 2 && !strcmp(argv[1], "-h"))
> - usage(update_index_usage[0]);
> + usage_with_options(&update_index_usage[0], options);
>
> git_config(git_default_config, NULL);
>
Ok I just realized that
usage_with_options(update_index_usage, options);
would be better...
Antoine,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] update-index: allow "-h" to also display options
2013-02-23 18:13 ` Antoine Pelisse
@ 2013-02-23 21:25 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2013-02-23 21:25 UTC (permalink / raw)
To: Antoine Pelisse; +Cc: git
Antoine Pelisse <apelisse@gmail.com> writes:
>> diff --git a/builtin/update-index.c b/builtin/update-index.c
>> index ada1dff..3071ee6 100644
>> --- a/builtin/update-index.c
>> +++ b/builtin/update-index.c
>> @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
>> };
>>
>> if (argc == 2 && !strcmp(argv[1], "-h"))
>> - usage(update_index_usage[0]);
>> + usage_with_options(&update_index_usage[0], options);
>>
>> git_config(git_default_config, NULL);
>>
>
> Ok I just realized that
>
> usage_with_options(update_index_usage, options);
>
> would be better...
Yeah, that probably is easier on the eyes, even though they are
equivalent.
Thanks, will queue.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-23 21:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-23 18:10 [PATCH] update-index: allow "-h" to also display options Antoine Pelisse
2013-02-23 18:13 ` Antoine Pelisse
2013-02-23 21:25 ` 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