@@ -56,6 +56,11 @@ static char diff_colors[][COLOR_MAXLEN] = {
5656 GIT_COLOR_NORMAL , /* FUNCINFO */
5757};
5858
59+ static NORETURN void die_want_option (const char * option_name )
60+ {
61+ die (_ ("option '%s' requires a value" ), option_name );
62+ }
63+
5964static int parse_diff_color_slot (const char * var )
6065{
6166 if (!strcasecmp (var , "context" ) || !strcasecmp (var , "plain" ))
@@ -3341,7 +3346,7 @@ void diff_setup_done(struct diff_options *options)
33413346 if (options -> output_format & DIFF_FORMAT_NO_OUTPUT )
33423347 count ++ ;
33433348 if (count > 1 )
3344- die ("--name-only, --name-status, --check and -s are mutually exclusive" );
3349+ die (_ ( "--name-only, --name-status, --check and -s are mutually exclusive" ) );
33453350
33463351 /*
33473352 * Most of the time we can say "there are changes"
@@ -3537,7 +3542,7 @@ static int stat_opt(struct diff_options *options, const char **av)
35373542 if (* arg == '=' )
35383543 width = strtoul (arg + 1 , & end , 10 );
35393544 else if (!* arg && !av [1 ])
3540- die ( "Option ' --stat-width' requires a value " );
3545+ die_want_option ( " --stat-width" );
35413546 else if (!* arg ) {
35423547 width = strtoul (av [1 ], & end , 10 );
35433548 argcount = 2 ;
@@ -3546,7 +3551,7 @@ static int stat_opt(struct diff_options *options, const char **av)
35463551 if (* arg == '=' )
35473552 name_width = strtoul (arg + 1 , & end , 10 );
35483553 else if (!* arg && !av [1 ])
3549- die ( "Option ' --stat-name-width' requires a value " );
3554+ die_want_option ( " --stat-name-width" );
35503555 else if (!* arg ) {
35513556 name_width = strtoul (av [1 ], & end , 10 );
35523557 argcount = 2 ;
@@ -3555,7 +3560,7 @@ static int stat_opt(struct diff_options *options, const char **av)
35553560 if (* arg == '=' )
35563561 graph_width = strtoul (arg + 1 , & end , 10 );
35573562 else if (!* arg && !av [1 ])
3558- die ( "Option ' --stat-graph-width' requires a value " );
3563+ die_want_option ( " --stat-graph-width" );
35593564 else if (!* arg ) {
35603565 graph_width = strtoul (av [1 ], & end , 10 );
35613566 argcount = 2 ;
@@ -3564,7 +3569,7 @@ static int stat_opt(struct diff_options *options, const char **av)
35643569 if (* arg == '=' )
35653570 count = strtoul (arg + 1 , & end , 10 );
35663571 else if (!* arg && !av [1 ])
3567- die ( "Option ' --stat-count' requires a value " );
3572+ die_want_option ( " --stat-count" );
35683573 else if (!* arg ) {
35693574 count = strtoul (av [1 ], & end , 10 );
35703575 argcount = 2 ;
0 commit comments