X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rev-parse.c;fp=builtin-rev-parse.c;h=37d02335212dea9672e2472970f66dc4ac95dfd1;hb=750054cd3f1298bc9e113a47eaa6346923e08c19;hp=9526aafc6c732de60f05f799c46fbf139377cccf;hpb=1b8dbdb41e503f6829be4e1d8ada4c8eabbc49bd;p=git.git diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index 9526aafc6..37d023352 100644 --- a/builtin-rev-parse.c +++ b/builtin-rev-parse.c @@ -432,6 +432,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; @@ -444,6 +451,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++) {