@@ -4870,6 +4870,13 @@ static int parse_objfind_opt(struct diff_options *opt, const char *arg)
4870
4870
static void prep_parse_options (struct diff_options * options )
4871
4871
{
4872
4872
struct option parseopts [] = {
4873
+ OPT_GROUP (N_ ("Diff output format options" )),
4874
+ OPT_BITOP ('p' , "patch" , & options -> output_format ,
4875
+ N_ ("generate patch" ),
4876
+ DIFF_FORMAT_PATCH , DIFF_FORMAT_NO_OUTPUT ),
4877
+ OPT_BITOP ('u' , NULL , & options -> output_format ,
4878
+ N_ ("generate patch" ),
4879
+ DIFF_FORMAT_PATCH , DIFF_FORMAT_NO_OUTPUT ),
4873
4880
OPT_END ()
4874
4881
};
4875
4882
@@ -4898,8 +4905,7 @@ int diff_opt_parse(struct diff_options *options,
4898
4905
return ac ;
4899
4906
4900
4907
/* Output format options */
4901
- if (!strcmp (arg , "-p" ) || !strcmp (arg , "-u" ) || !strcmp (arg , "--patch" )
4902
- || opt_arg (arg , 'U' , "unified" , & options -> context ))
4908
+ if (opt_arg (arg , 'U' , "unified" , & options -> context ))
4903
4909
enable_patch_output (& options -> output_format );
4904
4910
else if (!strcmp (arg , "--raw" ))
4905
4911
options -> output_format |= DIFF_FORMAT_RAW ;
0 commit comments