提交 7006b5be 编写于 作者: J Jonathan Nieder 提交者: Junio C Hamano

Show usage string for 'git rev-parse -h'

Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 ae5bdda3
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册