@@ -4905,6 +4905,12 @@ static void prep_parse_options(struct diff_options *options)
49054905 N_ ("synonym for '-p --raw'" ),
49064906 DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW ,
49074907 DIFF_FORMAT_NO_OUTPUT ),
4908+ OPT_BIT_F (0 , "numstat" , & options -> output_format ,
4909+ N_ ("machine friendly --stat" ),
4910+ DIFF_FORMAT_NUMSTAT , PARSE_OPT_NONEG ),
4911+ OPT_BIT_F (0 , "shortstat" , & options -> output_format ,
4912+ N_ ("output only the last line of --stat" ),
4913+ DIFF_FORMAT_SHORTSTAT , PARSE_OPT_NONEG ),
49084914 OPT_END ()
49094915 };
49104916
@@ -4933,11 +4939,7 @@ int diff_opt_parse(struct diff_options *options,
49334939 return ac ;
49344940
49354941 /* Output format options */
4936- if (!strcmp (arg , "--numstat" ))
4937- options -> output_format |= DIFF_FORMAT_NUMSTAT ;
4938- else if (!strcmp (arg , "--shortstat" ))
4939- options -> output_format |= DIFF_FORMAT_SHORTSTAT ;
4940- else if (skip_prefix (arg , "-X" , & arg ) ||
4942+ if (skip_prefix (arg , "-X" , & arg ) ||
49414943 skip_to_optional_arg (arg , "--dirstat" , & arg ))
49424944 return parse_dirstat_opt (options , arg );
49434945 else if (!strcmp (arg , "--cumulative" ))
0 commit comments