Show usage string for 'git log -h', 'git show -h' and 'git diff -h'
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
4d590f0607
commit
1c370ea4e5
@ -218,6 +218,8 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
|
|||||||
revs->max_count = 3;
|
revs->max_count = 3;
|
||||||
else if (!strcmp(argv[1], "-q"))
|
else if (!strcmp(argv[1], "-q"))
|
||||||
options |= DIFF_SILENT_ON_REMOVED;
|
options |= DIFF_SILENT_ON_REMOVED;
|
||||||
|
else if (!strcmp(argv[1], "-h"))
|
||||||
|
usage(builtin_diff_usage);
|
||||||
else
|
else
|
||||||
return error("invalid option: %s", argv[1]);
|
return error("invalid option: %s", argv[1]);
|
||||||
argv++; argc--;
|
argv++; argc--;
|
||||||
|
@ -27,6 +27,10 @@ static int default_show_root = 1;
|
|||||||
static const char *fmt_patch_subject_prefix = "PATCH";
|
static const char *fmt_patch_subject_prefix = "PATCH";
|
||||||
static const char *fmt_pretty;
|
static const char *fmt_pretty;
|
||||||
|
|
||||||
|
static const char * const builtin_log_usage =
|
||||||
|
"git log [<options>] [<since>..<until>] [[--] <path>...]\n"
|
||||||
|
" or: git show [options] <object>...";
|
||||||
|
|
||||||
static void cmd_log_init(int argc, const char **argv, const char *prefix,
|
static void cmd_log_init(int argc, const char **argv, const char *prefix,
|
||||||
struct rev_info *rev)
|
struct rev_info *rev)
|
||||||
{
|
{
|
||||||
@ -61,6 +65,8 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
|
|||||||
rev->show_decorations = 1;
|
rev->show_decorations = 1;
|
||||||
} else if (!strcmp(arg, "--source")) {
|
} else if (!strcmp(arg, "--source")) {
|
||||||
rev->show_source = 1;
|
rev->show_source = 1;
|
||||||
|
} else if (!strcmp(arg, "-h")) {
|
||||||
|
usage(builtin_log_usage);
|
||||||
} else
|
} else
|
||||||
die("unrecognized argument: %s", arg);
|
die("unrecognized argument: %s", arg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user