Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 diff.c          | 6 +++---
 parse-options.h | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/diff.c b/diff.c
index 3e7c36524d..cc10b27df0 100644
--- a/diff.c
+++ b/diff.c
@@ -5311,6 +5311,9 @@ static void prep_parse_options(struct diff_options 
*options)
                OPT_CALLBACK_F(0, "no-prefix", options, NULL,
                               N_("no not show any source or destination 
prefix"),
                               PARSE_OPT_NONEG | PARSE_OPT_NOARG, 
diff_opt_no_prefix),
+               OPT_INTEGER_F(0, "inter-hunk-context", 
&options->interhunkcontext,
+                             N_("show context between diff hunks up to the 
specified number of lines"),
+                             PARSE_OPT_NONEG),
                OPT_CALLBACK_F(0, "output-indicator-new",
                               
&options->output_indicators[OUTPUT_INDICATOR_NEW],
                               N_("<char>"),
@@ -5503,9 +5506,6 @@ int diff_opt_parse(struct diff_options *options,
        }
 
        /* misc options */
-       else if (opt_arg(arg, '\0', "inter-hunk-context",
-                        &options->interhunkcontext))
-               ;
        else
                return 0;
        return 1;
diff --git a/parse-options.h b/parse-options.h
index c95cbe26f0..cca64d04cb 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -137,6 +137,7 @@ struct option {
 #define OPT_CALLBACK_F(s, l, v, a, h, f, cb)                   \
        { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), (cb) }
 #define OPT_STRING_F(s, l, v, a, h, f)   { OPTION_STRING,  (s), (l), (v), (a), 
(h), (f) }
+#define OPT_INTEGER_F(s, l, v, h, f)     { OPTION_INTEGER, (s), (l), (v), 
N_("n"), (h), (f) }
 
 #define OPT_END()                   { OPTION_END }
 #define OPT_ARGUMENT(l, h)          { OPTION_ARGUMENT, 0, (l), NULL, NULL, \
@@ -155,7 +156,7 @@ struct option {
                                      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, 
NULL, 1}
 #define OPT_CMDMODE(s, l, v, h, i)  { OPTION_CMDMODE, (s), (l), (v), NULL, \
                                      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, 
NULL, (i) }
-#define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_("n"), 
(h) }
+#define OPT_INTEGER(s, l, v, h)     OPT_INTEGER_F(s, l, v, h, 0)
 #define OPT_MAGNITUDE(s, l, v, h)   { OPTION_MAGNITUDE, (s), (l), (v), \
                                      N_("n"), (h), PARSE_OPT_NONEG }
 #define OPT_STRING(s, l, v, a, h)   OPT_STRING_F(s, l, v, a, h, 0)
-- 
2.20.0.482.g66447595a7

Reply via email to