@@ -4896,6 +4896,8 @@ static void prep_parse_options(struct diff_options *options)
4896
4896
OPT_CALLBACK_F ('U' , "unified" , options , N_ ("<n>" ),
4897
4897
N_ ("generate diffs with <n> lines context" ),
4898
4898
PARSE_OPT_NONEG , diff_opt_unified ),
4899
+ OPT_BOOL ('W' , "function-context" , & options -> flags .funccontext ,
4900
+ N_ ("generate diffs with <n> lines context" )),
4899
4901
OPT_END ()
4900
4902
};
4901
4903
@@ -5212,12 +5214,6 @@ int diff_opt_parse(struct diff_options *options,
5212
5214
else if (opt_arg (arg , '\0' , "inter-hunk-context" ,
5213
5215
& options -> interhunkcontext ))
5214
5216
;
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 ;
5221
5217
else if ((argcount = parse_long_opt ("output" , av , & optarg ))) {
5222
5218
char * path = prefix_filename (prefix , optarg );
5223
5219
options -> file = xfopen (path , "w" );
0 commit comments