summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2009-11-09 09:04:54 -0600
committerJunio C Hamano <gitster@pobox.com>2009-11-10 11:06:57 -0800
commit7006b5beceb296e7e853806622204b2b55649fc5 (patch)
tree03f892c9f6d081e9e155aa9665b8e413e2cf86ca
parentae5bdda36cddeb837dc43804966bc99baa385772 (diff)
downloadgit-7006b5beceb296e7e853806622204b2b55649fc5.tar.gz
Show usage string for 'git rev-parse -h'
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-rev-parse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 45bead6545..24ee8b3242 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -426,6 +426,13 @@ static void die_no_single_rev(int quiet)
die("Needed a single revision");
}
+static const char builtin_rev_parse_usage[] =
+"git rev-parse --parseopt [options] -- [<args>...]\n"
+" or: git rev-parse --sq-quote [<arg>...]\n"
+" or: git rev-parse [options] [<arg>...]\n"
+"\n"
+"Run \"git rev-parse --parseopt -h\" for more information on the first usage.";
+
int cmd_rev_parse(int argc, const char **argv, const char *prefix)
{
int i, as_is = 0, verify = 0, quiet = 0, revs_count = 0, type = 0;
@@ -438,6 +445,9 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
if (argc > 1 && !strcmp("--sq-quote", argv[1]))
return cmd_sq_quote(argc - 2, argv + 2);
+ if (argc > 1 && !strcmp("-h", argv[1]))
+ usage(builtin_rev_parse_usage);
+
prefix = setup_git_directory();
git_config(git_default_config, NULL);
for (i = 1; i < argc; i++) {