@@ -6,8 +6,8 @@ pub fn cli() -> Command {
66 subcommand ( "publish" )
77 . about ( "Upload a package to the registry" )
88 . arg_dry_run ( "Perform all checks without uploading" )
9- . arg_index ( )
10- . arg ( opt ( "registry" , " Registry to publish to") . value_name ( "REGISTRY" ) )
9+ . arg_index ( "Registry index URL to upload the package to" )
10+ . arg_registry ( " Registry to upload the package to")
1111 . arg ( opt ( "token" , "Token to use when uploading" ) . value_name ( "TOKEN" ) )
1212 . arg ( flag (
1313 "no-verify" ,
@@ -30,7 +30,7 @@ pub fn cli() -> Command {
3030}
3131
3232pub fn exec ( config : & mut Config , args : & ArgMatches ) -> CliResult {
33- let registry = args. registry ( config) ?;
33+ let reg_or_index = args. registry_or_index ( config) ?;
3434 let ws = args. workspace ( config) ?;
3535 if ws. root_maybe ( ) . is_embedded ( ) {
3636 return Err ( anyhow:: format_err!(
@@ -39,7 +39,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
3939 )
4040 . into ( ) ) ;
4141 }
42- let index = args. index ( ) ?;
4342
4443 ops:: publish (
4544 & ws,
@@ -48,15 +47,14 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
4847 token : args
4948 . get_one :: < String > ( "token" )
5049 . map ( |s| s. to_string ( ) . into ( ) ) ,
51- index ,
50+ reg_or_index ,
5251 verify : !args. flag ( "no-verify" ) ,
5352 allow_dirty : args. flag ( "allow-dirty" ) ,
5453 to_publish : args. packages_from_flags ( ) ?,
5554 targets : args. targets ( ) ?,
5655 jobs : args. jobs ( ) ?,
5756 keep_going : args. keep_going ( ) ,
5857 dry_run : args. dry_run ( ) ,
59- registry,
6058 cli_features : args. cli_features ( ) ?,
6159 } ,
6260 ) ?;
0 commit comments