@matheusbsbs / matheus-bagliano / commits / 7006b5bece
Fork 0

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>

Jonathan Nieder committed Nov 9, 2009 at 09:04 UTC 7006b5beceb296e7e853806622204b2b55649fc5
1 file changed +10
builtin-rev-parse.c
+10
@@ -426,6 +426,13 @@ static void die_no_single_rev(int quiet)
426 die("Needed a single revision");
427 }
428
429 +static const char builtin_rev_parse_usage[] =
430 +"git rev-parse --parseopt [options] -- [<args>...]\n"
431 +" or: git rev-parse --sq-quote [<arg>...]\n"
432 +" or: git rev-parse [options] [<arg>...]\n"
433 +"\n"
434 +"Run \"git rev-parse --parseopt -h\" for more information on the first usage.";
435 +
436 int cmd_rev_parse(int argc, const char **argv, const char *prefix)
437 {
438 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)
445 if (argc > 1 && !strcmp("--sq-quote", argv[1]))
446 return cmd_sq_quote(argc - 2, argv + 2);
447
448 + if (argc > 1 && !strcmp("-h", argv[1]))
449 + usage(builtin_rev_parse_usage);
450 +
451 prefix = setup_git_directory();
452 git_config(git_default_config, NULL);
453 for (i = 1; i < argc; i++) {