@@ -800,7 +800,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
800
800
// let mut req_pos_from_name = None;
801
801
if let Some ( p) = self . positionals_idx . get ( & pos_counter) {
802
802
if self . blacklist . contains ( p. name ) {
803
- self . report_error ( format ! ( "The argument \" {}\" is mutually exclusive with one or more other arguments" , arg) ,
803
+ self . report_error ( format ! ( "The argument \" {}\" cannot be used with one or more of the other specified arguments" , arg) ,
804
804
true , true ) ;
805
805
}
806
806
@@ -872,12 +872,14 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
872
872
}
873
873
_ => { }
874
874
}
875
+
876
+ self . validate_blacklist ( & matches) ;
877
+
875
878
if !self . required . is_empty ( ) {
876
879
self . report_error ( "One or more required arguments were not supplied" . to_owned ( ) ,
877
880
true , true ) ;
878
881
}
879
882
880
- self . validate_blacklist ( & matches) ;
881
883
882
884
if let Some ( sc_name) = subcmd_name {
883
885
if let Some ( ref mut sc) = self . subcommands . get_mut ( & sc_name) {
@@ -952,7 +954,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
952
954
if let Some ( v) = self . opts . values ( ) . filter ( |& v| v. long . is_some ( ) ) . filter ( |& v| v. long . unwrap ( ) == arg) . nth ( 0 ) {
953
955
// Ensure this option isn't on the master mutually excludes list
954
956
if self . blacklist . contains ( v. name ) {
955
- self . report_error ( format ! ( "The argument --{} is mutually exclusive with one or more other arguments" , arg) ,
957
+ self . report_error ( format ! ( "The argument --{} cannot be used with one or more of the other specified arguments" , arg) ,
956
958
true , true ) ;
957
959
}
958
960
@@ -1019,7 +1021,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
1019
1021
if let Some ( v) = self . flags . values ( ) . filter ( |& v| v. long . is_some ( ) ) . filter ( |& v| v. long . unwrap ( ) == arg) . nth ( 0 ) {
1020
1022
// Ensure this flag isn't on the mutually excludes list
1021
1023
if self . blacklist . contains ( v. name ) {
1022
- self . report_error ( format ! ( "The argument --{} is mutually exclusive with one or more other arguments" , arg) ,
1024
+ self . report_error ( format ! ( "The argument --{} cannot be used with one or more of the other specified arguments" , arg) ,
1023
1025
true , true ) ;
1024
1026
}
1025
1027
@@ -1101,7 +1103,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
1101
1103
if let Some ( v) = self . opts . values ( ) . filter ( |& v| v. short . is_some ( ) ) . filter ( |& v| v. short . unwrap ( ) == arg_c) . nth ( 0 ) {
1102
1104
// Ensure this option isn't on the master mutually excludes list
1103
1105
if self . blacklist . contains ( v. name ) {
1104
- self . report_error ( format ! ( "The argument -- {} is mutually exclusive with one or more other arguments" , arg) ,
1106
+ self . report_error ( format ! ( "The argument -{} cannot be used with one or more of the other specified arguments" , arg) ,
1105
1107
true , true ) ;
1106
1108
}
1107
1109
@@ -1152,7 +1154,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
1152
1154
for v in self . flags . values ( ) . filter ( |& v| v. short . is_some ( ) ) . filter ( |& v| v. short . unwrap ( ) == arg) {
1153
1155
// Ensure this flag isn't on the mutually excludes list
1154
1156
if self . blacklist . contains ( v. name ) {
1155
- self . report_error ( format ! ( "The argument -{} is mutually exclusive with one or more other arguments" , arg) ,
1157
+ self . report_error ( format ! ( "The argument -{} cannot be used with one or more of the other specified arguments" , arg) ,
1156
1158
true , true ) ;
1157
1159
}
1158
1160
@@ -1208,7 +1210,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
1208
1210
fn validate_blacklist ( & self , matches : & ArgMatches < ' ar > ) {
1209
1211
for name in self . blacklist . iter ( ) {
1210
1212
if matches. flags . contains_key ( name) {
1211
- self . report_error ( format ! ( "The argument {} is mutually exclusive with one or more other arguments" ,
1213
+ self . report_error ( format ! ( "The argument {} cannot be used with one or more of the other specified arguments" ,
1212
1214
if let Some ( s) = self . flags. get( name) . unwrap( ) . short {
1213
1215
format!( "-{}" , s)
1214
1216
} else if let Some ( l) = self . flags. get( name) . unwrap( ) . long {
@@ -1218,17 +1220,17 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
1218
1220
} ) , true , true ) ;
1219
1221
}
1220
1222
if matches. opts . contains_key ( name) {
1221
- self . report_error ( format ! ( "The argument {} is mutually exclusive with one or more other arguments" ,
1222
- if let Some ( s) = self . opts. get( name) . unwrap( ) . short {
1223
- format!( "-{}" , s)
1224
- } else if let Some ( l) = self . opts. get( name) . unwrap( ) . long {
1225
- format!( "-- {}" , l)
1223
+ self . report_error ( format ! ( "The argument {} cannot be used with one or more of the other specified arguments" ,
1224
+ if let Some ( s) = self . opts. get( name) . unwrap( ) . long {
1225
+ format!( "-- {}" , s)
1226
+ } else if let Some ( l) = self . opts. get( name) . unwrap( ) . short {
1227
+ format!( "-{}" , l)
1226
1228
} else {
1227
1229
format!( "\" {}\" " , name)
1228
1230
} ) , true , true ) ;
1229
1231
}
1230
1232
if matches. positionals . contains_key ( name) {
1231
- self . report_error ( format ! ( "The argument \" {}\" is mutually exclusive with one or more other arguments" , name) ,
1233
+ self . report_error ( format ! ( "The argument \" {}\" cannot be used with one or more of the other specified arguments" , name) ,
1232
1234
false , true ) ;
1233
1235
}
1234
1236
}
0 commit comments