diff-parseopt: convert --summary
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Feb 21, 2019 at 18:16 UTC
70a304179a518c8890cc937486bc3f806c557c8c
1 file changed
+4
-3
diff.c
+4
-3
@@ -4942,6 +4942,9 @@ static void prep_parse_options(struct diff_options *options)
4942
OPT_BIT_F(0, "check", &options->output_format,
4943
N_("warn if changes introduce conflict markers or whitespace errors"),
4944
DIFF_FORMAT_CHECKDIFF, PARSE_OPT_NONEG),
4945
+ OPT_BIT_F(0, "summary", &options->output_format,
4946
+ N_("condensed summary such as creations, renames and mode changes"),
4947
+ DIFF_FORMAT_SUMMARY, PARSE_OPT_NONEG),
4948
OPT_END()
4949
};
4950
@@ -4970,9 +4973,7 @@ int diff_opt_parse(struct diff_options *options,
4973
return ac;
4974
4975
/* Output format options */
4973
- if (!strcmp(arg, "--summary"))
4974
- options->output_format |= DIFF_FORMAT_SUMMARY;
4975
- else if (!strcmp(arg, "--patch-with-stat")) {
4976
+ if (!strcmp(arg, "--patch-with-stat")) {
4977
enable_patch_output(&options->output_format);
4978
options->output_format |= DIFF_FORMAT_DIFFSTAT;
4979
} else if (!strcmp(arg, "--name-only"))