提交 e5673620 编写于 作者: N Nguyễn Thái Ngọc Duy 提交者: Junio C Hamano

diff-parseopt: convert --numstat and --shortstat

Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 c659f303
......@@ -4905,6 +4905,12 @@ static void prep_parse_options(struct diff_options *options)
N_("synonym for '-p --raw'"),
DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW,
DIFF_FORMAT_NO_OUTPUT),
OPT_BIT_F(0, "numstat", &options->output_format,
N_("machine friendly --stat"),
DIFF_FORMAT_NUMSTAT, PARSE_OPT_NONEG),
OPT_BIT_F(0, "shortstat", &options->output_format,
N_("output only the last line of --stat"),
DIFF_FORMAT_SHORTSTAT, PARSE_OPT_NONEG),
OPT_END()
};
......@@ -4933,11 +4939,7 @@ int diff_opt_parse(struct diff_options *options,
return ac;
/* Output format options */
if (!strcmp(arg, "--numstat"))
options->output_format |= DIFF_FORMAT_NUMSTAT;
else if (!strcmp(arg, "--shortstat"))
options->output_format |= DIFF_FORMAT_SHORTSTAT;
else if (skip_prefix(arg, "-X", &arg) ||
if (skip_prefix(arg, "-X", &arg) ||
skip_to_optional_arg(arg, "--dirstat", &arg))
return parse_dirstat_opt(options, arg);
else if (!strcmp(arg, "--cumulative"))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册