Skip to content

Commit 7fd9a1b

Browse files
pcloudsgitster
authored andcommitted
diff.c: convert -W|--[no-]function-context
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d473e2e commit 7fd9a1b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

diff.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4896,6 +4896,8 @@ static void prep_parse_options(struct diff_options *options)
48964896
OPT_CALLBACK_F('U', "unified", options, N_("<n>"),
48974897
N_("generate diffs with <n> lines context"),
48984898
PARSE_OPT_NONEG, diff_opt_unified),
4899+
OPT_BOOL('W', "function-context", &options->flags.funccontext,
4900+
N_("generate diffs with <n> lines context")),
48994901
OPT_END()
49004902
};
49014903

@@ -5212,12 +5214,6 @@ int diff_opt_parse(struct diff_options *options,
52125214
else if (opt_arg(arg, '\0', "inter-hunk-context",
52135215
&options->interhunkcontext))
52145216
;
5215-
else if (!strcmp(arg, "-W"))
5216-
options->flags.funccontext = 1;
5217-
else if (!strcmp(arg, "--function-context"))
5218-
options->flags.funccontext = 1;
5219-
else if (!strcmp(arg, "--no-function-context"))
5220-
options->flags.funccontext = 0;
52215217
else if ((argcount = parse_long_opt("output", av, &optarg))) {
52225218
char *path = prefix_filename(prefix, optarg);
52235219
options->file = xfopen(path, "w");

0 commit comments

Comments
 (0)