summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e919cb3)
raw | patch | inline | side by side (parent: e919cb3)
author | Teemu Likonen <tlikonen@iki.fi> | |
Thu, 5 Jun 2008 21:15:36 +0000 (00:15 +0300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 6 Jun 2008 16:22:18 +0000 (09:22 -0700) |
Git's main usage pages did not show "git help" as a way to get more
information on a specific subcommand. This patch adds an info line after
the list of git commands currently printed by "git", "git help", "git
--help" and "git help --all".
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
information on a specific subcommand. This patch adds an info line after
the list of git commands currently printed by "git", "git help", "git
--help" and "git help --all".
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin.h | patch | blob | history | |
git.c | patch | blob | history | |
help.c | patch | blob | history |
diff --git a/builtin.h b/builtin.h
index 8bda1117e4c56b38ac799f60d39310ffc51b9b63..b460b2da6f41797ca3190646eb3fe5cafd1abd84 100644 (file)
--- a/builtin.h
+++ b/builtin.h
extern const char git_version_string[];
extern const char git_usage_string[];
+extern const char git_more_info_string[];
extern void list_common_cmds_help(void);
extern void help_unknown_cmd(const char *cmd);
index 272bf03da3b3aee7dbdb088ddc1042c18567492a..15a0e71cc1f5d7ad032a2b0591e526f9b0ca8b0b 100644 (file)
--- a/git.c
+++ b/git.c
const char git_usage_string[] =
"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]";
+const char git_more_info_string[] =
+ "See 'git help COMMAND' for more information on a specific command.";
+
static int handle_options(const char*** argv, int* argc, int* envchanged)
{
int handled = 0;
/* The user didn't specify a command; give them help */
printf("usage: %s\n\n", git_usage_string);
list_common_cmds_help();
+ printf("\n%s\n", git_more_info_string);
exit(1);
}
cmd = argv[0];
index d89d43796f3ee9d3689131d48861967048f5c5d7..8aff94c64a1204f8a359e522a554f29c8f0fdc20 100644 (file)
--- a/help.c
+++ b/help.c
if (show_all) {
printf("usage: %s\n\n", git_usage_string);
list_commands();
+ printf("%s\n", git_more_info_string);
return 0;
}
if (!argv[0]) {
printf("usage: %s\n\n", git_usage_string);
list_common_cmds_help();
+ printf("\n%s\n", git_more_info_string);
return 0;
}