File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,12 @@ pub trait CommandExt: Sized {
291
291
}
292
292
293
293
fn arg_index ( self , help : & ' static str ) -> Self {
294
- self . _arg ( opt ( "index" , help) . value_name ( "INDEX" ) )
294
+ // Always conflicts with `--registry`.
295
+ self . _arg (
296
+ opt ( "index" , help)
297
+ . value_name ( "INDEX" )
298
+ . conflicts_with ( "registry" ) ,
299
+ )
295
300
}
296
301
297
302
fn arg_dry_run ( self , dry_run : & ' static str ) -> Self {
Original file line number Diff line number Diff line change @@ -1389,10 +1389,9 @@ fn both_index_and_registry() {
1389
1389
p. cargo ( cmd)
1390
1390
. arg ( "--registry=foo" )
1391
1391
. arg ( "--index=foo" )
1392
- . with_status ( 101 )
1393
- . with_stderr (
1394
- "[ERROR] both `--index` and `--registry` \
1395
- should not be set at the same time",
1392
+ . with_status ( 1 )
1393
+ . with_stderr_contains (
1394
+ "error: the argument '--registry <REGISTRY>' cannot be used with '--index <INDEX>'" ,
1396
1395
)
1397
1396
. run ( ) ;
1398
1397
}
You can’t perform that action at this time.
0 commit comments