update-index: allow "-h" to also display options
PATCH 1/1 update-index: allow "-h" to also display options
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.
--- builtin/update-index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/update-index.c +1 -1
@@ -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 );
Signature · 1 line
1.7.9.5
builtin/update-index.c int cmd_update_index(int argc, const char **argv, const char *prefix) · line 802
Quoted 13 lines
builtin/update-index.c +1
-1@@ -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,
Quoted 11 lines · Antoine Pelisse
Quoted 11 lines
builtin/update-index.c +1
-1@@ -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);
Quoted 8 lines
builtin/update-index.c int cmd_update_index(int argc, const char **argv, const char *prefix) · line 802
Quoted 2 lines
builtin/update-index.c +0
-0git_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.