diff-parseopt: convert --exit-code

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 1086ea0cc24c74b464bc092c6ecc5166a928e3ce
1 file changed +3 -3
diff.c
+3 -3
@@ -5297,6 +5297,8 @@ static void prep_parse_options(struct diff_options *options)
5297 N_("treat all files as text")),
5298 OPT_BOOL('R', NULL, &options->flags.reverse_diff,
5299 N_("swap two inputs, reverse the diff")),
5300 + OPT_BOOL(0, "exit-code", &options->flags.exit_with_status,
5301 + N_("exit with 1 if there were differences, 0 otherwise")),
5302 { OPTION_CALLBACK, 0, "output", options, N_("<file>"),
5303 N_("Output to a specific file"),
5304 PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5346,9 +5348,7 @@ int diff_opt_parse(struct diff_options *options,
5348 if (cm & COLOR_MOVED_WS_ERROR)
5349 return -1;
5350 options->color_moved_ws_handling = cm;
5349 - } else if (!strcmp(arg, "--exit-code"))
5350 - options->flags.exit_with_status = 1;
5351 - else if (!strcmp(arg, "--quiet"))
5351 + } else if (!strcmp(arg, "--quiet"))
5352 options->flags.quick = 1;
5353 else if (!strcmp(arg, "--ext-diff"))
5354 options->flags.allow_external = 1;