diff-parseopt: convert --full-index
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Tue, 5 Mar 2019 12:30:13 +0000 (19:30 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Mar 2019 23:02:21 +0000 (08:02 +0900)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
diff --git a/diff.c b/diff.c
index 214728c892ad98a08461f535b15e1019ed97f223..3a13ba37fd68203967036864d100033f35e71595 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -5131,6 +5131,8 @@ static void prep_parse_options(struct diff_options *options)
                OPT_CALLBACK_F(0, "binary", options, NULL,
                               N_("output a binary diff that can be applied"),
                               PARSE_OPT_NONEG | PARSE_OPT_NOARG, diff_opt_binary),
+               OPT_BOOL(0, "full-index", &options->flags.full_index,
+                        N_("show full pre- and post-image object names on the \"index\" lines")),
                OPT_CALLBACK_F(0, "output-indicator-new",
                               &options->output_indicators[OUTPUT_INDICATOR_NEW],
                               N_("<char>"),
@@ -5244,9 +5246,7 @@ int diff_opt_parse(struct diff_options *options,
                return ac;
 
        /* flags options */
-       if (!strcmp(arg, "--full-index"))
-               options->flags.full_index = 1;
-       else if (!strcmp(arg, "-a") || !strcmp(arg, "--text"))
+       if (!strcmp(arg, "-a") || !strcmp(arg, "--text"))
                options->flags.text = 1;
        else if (!strcmp(arg, "-R"))
                options->flags.reverse_diff = 1;