projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support "git cmd --help" syntax
[git.git]
/
git.c
diff --git
a/git.c
b/git.c
index
61265a8
..
140ed18
100644
(file)
--- a/
git.c
+++ b/
git.c
@@
-413,6
+413,12
@@
static void handle_internal_command(int argc, const char **argv, char **envp)
};
int i;
};
int i;
+ /* Turn "git cmd --help" into "git help cmd" */
+ if (argc > 1 && !strcmp(argv[1], "--help")) {
+ argv[1] = argv[0];
+ argv[0] = cmd = "help";
+ }
+
for (i = 0; i < ARRAY_SIZE(commands); i++) {
struct cmd_struct *p = commands+i;
if (strcmp(p->cmd, cmd))
for (i = 0; i < ARRAY_SIZE(commands); i++) {
struct cmd_struct *p = commands+i;
if (strcmp(p->cmd, cmd))