From: Jonathan Nieder Date: Mon, 9 Nov 2009 15:04:54 +0000 (-0600) Subject: Show usage string for 'git rev-parse -h' X-Git-Tag: v1.6.6-rc0~34^2~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7006b5beceb296e7e853806622204b2b55649fc5;p=git.git Show usage string for 'git rev-parse -h' Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index 45bead654..24ee8b324 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] -- [...]\n" +" or: git rev-parse --sq-quote [...]\n" +" or: git rev-parse [options] [...]\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++) {