diff-parseopt: convert -R
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
Mar 5, 2019 at 19:30 UTC
4f99f299058c4ce07add3075175ea6ad5178bb31
1 file changed
+3
-3
diff.c
+3
-3
@@ -5216,6 +5216,8 @@ static void prep_parse_options(struct diff_options *options)
5216
diff_opt_relative),
5217
OPT_BOOL('a', "text", &options->flags.text,
5218
N_("treat all files as text")),
5219
+ OPT_BOOL('R', NULL, &options->flags.reverse_diff,
5220
+ N_("swap two inputs, reverse the diff")),
5221
{ OPTION_CALLBACK, 0, "output", options, N_("<file>"),
5222
N_("Output to a specific file"),
5223
PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5248,9 +5250,7 @@ int diff_opt_parse(struct diff_options *options,
5250
return ac;
5251
5252
/* flags options */
5251
- if (!strcmp(arg, "-R"))
5252
- options->flags.reverse_diff = 1;
5253
- else if (!strcmp(arg, "--follow"))
5253
+ if (!strcmp(arg, "--follow"))
5254
options->flags.follow_renames = 1;
5255
else if (!strcmp(arg, "--no-follow")) {
5256
options->flags.follow_renames = 0;