X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=git.c;h=140ed1873d7b5e334452cc8f8ac75a0541e32b6c;hb=1cd95087c331e17c44a8b62f0614d55e621dcfd4;hp=61265a85661a3b56c6ad437099ab0c85e9fbe158;hpb=6f4780f9dfd3bc6b23f9ea66b3d49577e0a0c2f9;p=git.git diff --git a/git.c b/git.c index 61265a85..140ed187 100644 --- a/git.c +++ b/git.c @@ -413,6 +413,12 @@ static void handle_internal_command(int argc, const char **argv, char **envp) }; 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))