summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae5bdda)
raw | patch | inline | side by side (parent: ae5bdda)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 9 Nov 2009 15:04:54 +0000 (09:04 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Nov 2009 19:06:57 +0000 (11:06 -0800) |
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-rev-parse.c | patch | blob | history |
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 45bead65451e87a4b564e59fed3518a4de9198e9..24ee8b32421a487cba7db768981943471f7a36fd 100644 (file)
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
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;
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++) {