@@ -941,7 +941,7 @@ int cmd_cat_file(int argc,
941
941
int input_nul_terminated = 0 ;
942
942
int nul_terminated = 0 ;
943
943
944
- const char * const usage [] = {
944
+ const char * const builtin_catfile_usage [] = {
945
945
N_ ("git cat-file <type> <object>" ),
946
946
N_ ("git cat-file (-e | -p) <object>" ),
947
947
N_ ("git cat-file (-t | -s) [--allow-unknown-type] <object>" ),
@@ -1007,7 +1007,7 @@ int cmd_cat_file(int argc,
1007
1007
1008
1008
batch .buffer_output = -1 ;
1009
1009
1010
- argc = parse_options (argc , argv , prefix , options , usage , 0 );
1010
+ argc = parse_options (argc , argv , prefix , options , builtin_catfile_usage , 0 );
1011
1011
opt_cw = (opt == 'c' || opt == 'w' );
1012
1012
opt_epts = (opt == 'e' || opt == 'p' || opt == 't' || opt == 's' );
1013
1013
@@ -1021,28 +1021,28 @@ int cmd_cat_file(int argc,
1021
1021
/* Option compatibility */
1022
1022
if (force_path && !opt_cw )
1023
1023
usage_msg_optf (_ ("'%s=<%s>' needs '%s' or '%s'" ),
1024
- usage , options ,
1024
+ builtin_catfile_usage , options ,
1025
1025
"--path" , _ ("path|tree-ish" ), "--filters" ,
1026
1026
"--textconv" );
1027
1027
1028
1028
/* Option compatibility with batch mode */
1029
1029
if (batch .enabled )
1030
1030
;
1031
1031
else if (batch .follow_symlinks )
1032
- usage_msg_optf (_ ("'%s' requires a batch mode" ), usage , options ,
1033
- "--follow-symlinks" );
1032
+ usage_msg_optf (_ ("'%s' requires a batch mode" ), builtin_catfile_usage ,
1033
+ options , "--follow-symlinks" );
1034
1034
else if (batch .buffer_output >= 0 )
1035
- usage_msg_optf (_ ("'%s' requires a batch mode" ), usage , options ,
1036
- "--buffer" );
1035
+ usage_msg_optf (_ ("'%s' requires a batch mode" ), builtin_catfile_usage ,
1036
+ options , "--buffer" );
1037
1037
else if (batch .all_objects )
1038
- usage_msg_optf (_ ("'%s' requires a batch mode" ), usage , options ,
1039
- "--batch-all-objects" );
1038
+ usage_msg_optf (_ ("'%s' requires a batch mode" ), builtin_catfile_usage ,
1039
+ options , "--batch-all-objects" );
1040
1040
else if (input_nul_terminated )
1041
- usage_msg_optf (_ ("'%s' requires a batch mode" ), usage , options ,
1042
- "-z" );
1041
+ usage_msg_optf (_ ("'%s' requires a batch mode" ), builtin_catfile_usage ,
1042
+ options , "-z" );
1043
1043
else if (nul_terminated )
1044
- usage_msg_optf (_ ("'%s' requires a batch mode" ), usage , options ,
1045
- "-Z" );
1044
+ usage_msg_optf (_ ("'%s' requires a batch mode" ), builtin_catfile_usage ,
1045
+ options , "-Z" );
1046
1046
1047
1047
batch .input_delim = batch .output_delim = '\n' ;
1048
1048
if (input_nul_terminated )
@@ -1063,33 +1063,36 @@ int cmd_cat_file(int argc,
1063
1063
batch .transform_mode = opt ;
1064
1064
else if (opt && opt != 'b' )
1065
1065
usage_msg_optf (_ ("'-%c' is incompatible with batch mode" ),
1066
- usage , options , opt );
1066
+ builtin_catfile_usage , options , opt );
1067
1067
else if (argc )
1068
- usage_msg_opt (_ ("batch modes take no arguments" ), usage ,
1069
- options );
1068
+ usage_msg_opt (_ ("batch modes take no arguments" ),
1069
+ builtin_catfile_usage , options );
1070
1070
1071
1071
return batch_objects (& batch );
1072
1072
}
1073
1073
1074
1074
if (opt ) {
1075
1075
if (!argc && opt == 'c' )
1076
1076
usage_msg_optf (_ ("<rev> required with '%s'" ),
1077
- usage , options , "--textconv" );
1077
+ builtin_catfile_usage , options ,
1078
+ "--textconv" );
1078
1079
else if (!argc && opt == 'w' )
1079
1080
usage_msg_optf (_ ("<rev> required with '%s'" ),
1080
- usage , options , "--filters" );
1081
+ builtin_catfile_usage , options ,
1082
+ "--filters" );
1081
1083
else if (!argc && opt_epts )
1082
1084
usage_msg_optf (_ ("<object> required with '-%c'" ),
1083
- usage , options , opt );
1085
+ builtin_catfile_usage , options , opt );
1084
1086
else if (argc == 1 )
1085
1087
obj_name = argv [0 ];
1086
1088
else
1087
- usage_msg_opt (_ ("too many arguments" ), usage , options );
1089
+ usage_msg_opt (_ ("too many arguments" ), builtin_catfile_usage ,
1090
+ options );
1088
1091
} else if (!argc ) {
1089
- usage_with_options (usage , options );
1092
+ usage_with_options (builtin_catfile_usage , options );
1090
1093
} else if (argc != 2 ) {
1091
1094
usage_msg_optf (_ ("only two arguments allowed in <type> <object> mode, not %d" ),
1092
- usage , options , argc );
1095
+ builtin_catfile_usage , options , argc );
1093
1096
} else if (argc ) {
1094
1097
exp_type = argv [0 ];
1095
1098
obj_name = argv [1 ];
0 commit comments