@@ -6,8 +6,8 @@ pub fn cli() -> Command {
6
6
subcommand ( "publish" )
7
7
. about ( "Upload a package to the registry" )
8
8
. 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")
11
11
. arg ( opt ( "token" , "Token to use when uploading" ) . value_name ( "TOKEN" ) )
12
12
. arg ( flag (
13
13
"no-verify" ,
@@ -30,7 +30,7 @@ pub fn cli() -> Command {
30
30
}
31
31
32
32
pub fn exec ( config : & mut Config , args : & ArgMatches ) -> CliResult {
33
- let registry = args. registry ( config) ?;
33
+ let reg_or_index = args. registry_or_index ( config) ?;
34
34
let ws = args. workspace ( config) ?;
35
35
if ws. root_maybe ( ) . is_embedded ( ) {
36
36
return Err ( anyhow:: format_err!(
@@ -39,7 +39,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
39
39
)
40
40
. into ( ) ) ;
41
41
}
42
- let index = args. index ( ) ?;
43
42
44
43
ops:: publish (
45
44
& ws,
@@ -48,15 +47,14 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
48
47
token : args
49
48
. get_one :: < String > ( "token" )
50
49
. map ( |s| s. to_string ( ) . into ( ) ) ,
51
- index ,
50
+ reg_or_index ,
52
51
verify : !args. flag ( "no-verify" ) ,
53
52
allow_dirty : args. flag ( "allow-dirty" ) ,
54
53
to_publish : args. packages_from_flags ( ) ?,
55
54
targets : args. targets ( ) ?,
56
55
jobs : args. jobs ( ) ?,
57
56
keep_going : args. keep_going ( ) ,
58
57
dry_run : args. dry_run ( ) ,
59
- registry,
60
58
cli_features : args. cli_features ( ) ?,
61
59
} ,
62
60
) ?;
0 commit comments