diff-parseopt: convert --ext-diff

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 0cda1003b785f0ac36f8c2975f70fdb6ab450987
1 file changed +3 -5
diff.c
+3 -5
@@ -5301,6 +5301,8 @@ static void prep_parse_options(struct diff_options *options)
5301 N_("exit with 1 if there were differences, 0 otherwise")),
5302 OPT_BOOL(0, "quiet", &options->flags.quick,
5303 N_("disable all output of the program")),
5304 + OPT_BOOL(0, "ext-diff", &options->flags.allow_external,
5305 + N_("allow an external diff helper to be executed")),
5306 { OPTION_CALLBACK, 0, "output", options, N_("<file>"),
5307 N_("Output to a specific file"),
5308 PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5350,11 +5352,7 @@ int diff_opt_parse(struct diff_options *options,
5352 if (cm & COLOR_MOVED_WS_ERROR)
5353 return -1;
5354 options->color_moved_ws_handling = cm;
5353 - } else if (!strcmp(arg, "--ext-diff"))
5354 - options->flags.allow_external = 1;
5355 - else if (!strcmp(arg, "--no-ext-diff"))
5356 - options->flags.allow_external = 0;
5357 - else if (!strcmp(arg, "--textconv")) {
5355 + } else if (!strcmp(arg, "--textconv")) {
5356 options->flags.allow_textconv = 1;
5357 options->flags.textconv_set_via_cmdline = 1;
5358 } else if (!strcmp(arg, "--no-textconv"))