@@ -4617,22 +4617,6 @@ static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *va
4617
4617
return 1 ;
4618
4618
}
4619
4619
4620
- static inline int short_opt (char opt , const char * * argv ,
4621
- const char * * optarg )
4622
- {
4623
- const char * arg = argv [0 ];
4624
- if (arg [0 ] != '-' || arg [1 ] != opt )
4625
- return 0 ;
4626
- if (arg [2 ] != '\0' ) {
4627
- * optarg = arg + 2 ;
4628
- return 1 ;
4629
- }
4630
- if (!argv [1 ])
4631
- die ("Option '%c' requires a value" , opt );
4632
- * optarg = argv [1 ];
4633
- return 2 ;
4634
- }
4635
-
4636
4620
int parse_long_opt (const char * opt , const char * * argv ,
4637
4621
const char * * optarg )
4638
4622
{
@@ -5397,6 +5381,8 @@ static void prep_parse_options(struct diff_options *options)
5397
5381
OPT_BIT_F (0 , "pickaxe-regex" , & options -> pickaxe_opts ,
5398
5382
N_ ("treat <string> in -S as extended POSIX regular expression" ),
5399
5383
DIFF_PICKAXE_REGEX , PARSE_OPT_NONEG ),
5384
+ OPT_FILENAME ('O' , NULL , & options -> orderfile ,
5385
+ N_ ("control the order in which files appear in the output" )),
5400
5386
{ OPTION_CALLBACK , 0 , "output" , options , N_ ("<file>" ),
5401
5387
N_ ("Output to a specific file" ),
5402
5388
PARSE_OPT_NONEG , NULL , 0 , diff_opt_output },
@@ -5449,10 +5435,7 @@ int diff_opt_parse(struct diff_options *options,
5449
5435
}
5450
5436
5451
5437
/* misc options */
5452
- else if ((argcount = short_opt ('O' , av , & optarg ))) {
5453
- options -> orderfile = prefix_filename (prefix , optarg );
5454
- return argcount ;
5455
- } else if (skip_prefix (arg , "--find-object=" , & arg ))
5438
+ else if (skip_prefix (arg , "--find-object=" , & arg ))
5456
5439
return parse_objfind_opt (options , arg );
5457
5440
else if ((argcount = parse_long_opt ("diff-filter" , av , & optarg ))) {
5458
5441
int offending = parse_diff_filter_opt (optarg , options );
0 commit comments