File tree Expand file tree Collapse file tree 13 files changed +25
-21
lines changed Expand file tree Collapse file tree 13 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ pub fn cli() -> Command {
7
7
. about ( "Create a new cargo package in an existing directory" )
8
8
. arg ( Arg :: new ( "path" ) . action ( ArgAction :: Set ) . default_value ( "." ) )
9
9
. arg_new_opts ( )
10
- . arg ( opt ( "registry" , " Registry to use") . value_name ( "REGISTRY" ) )
10
+ . arg_registry ( " Registry to use")
11
11
. arg_quiet ( )
12
12
. after_help ( color_print:: cstr!(
13
13
"Run `<cyan,bold>cargo help init</>` for more detailed information.\n "
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub fn cli() -> Command {
6
6
subcommand ( "login" )
7
7
. about ( "Log in to a registry." )
8
8
. arg ( Arg :: new ( "token" ) . action ( ArgAction :: Set ) )
9
- . arg ( opt ( "registry" , " Registry to use") . value_name ( "REGISTRY" ) )
9
+ . arg_registry ( " Registry to use")
10
10
. arg (
11
11
Arg :: new ( "args" )
12
12
. help ( "Arguments for the credential provider (unstable)" )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use cargo::ops;
4
4
pub fn cli ( ) -> Command {
5
5
subcommand ( "logout" )
6
6
. about ( "Remove an API token from the registry locally" )
7
- . arg ( opt ( "registry" , " Registry to use") . value_name ( "REGISTRY" ) )
7
+ . arg_registry ( " Registry to use")
8
8
. arg_quiet ( )
9
9
. after_help ( color_print:: cstr!(
10
10
"Run `<cyan,bold>cargo help logout</>` for more detailed information.\n "
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ pub fn cli() -> Command {
7
7
. about ( "Create a new cargo package at <path>" )
8
8
. arg ( Arg :: new ( "path" ) . action ( ArgAction :: Set ) . required ( true ) )
9
9
. arg_new_opts ( )
10
- . arg ( opt ( "registry" , " Registry to use") . value_name ( "REGISTRY" ) )
10
+ . arg_registry ( " Registry to use")
11
11
. arg_quiet ( )
12
12
. after_help ( color_print:: cstr!(
13
13
"Run `<cyan,bold>cargo help new</>` for more detailed information.\n "
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ pub fn cli() -> Command {
24
24
. short ( 'r' ) ,
25
25
)
26
26
. arg ( flag ( "list" , "List owners of a crate" ) . short ( 'l' ) )
27
- . arg ( opt ( "index" , "Registry index to modify owners for" ) . value_name ( "INDEX" ) )
27
+ . arg_index ( "Registry index URL to modify owners for" )
28
+ . arg_registry ( "Registry to modify owners for" )
28
29
. arg ( opt ( "token" , "API token to use when authenticating" ) . value_name ( "TOKEN" ) )
29
- . arg ( opt ( "registry" , "Registry to use" ) . value_name ( "REGISTRY" ) )
30
30
. arg_quiet ( )
31
31
. after_help ( color_print:: cstr!(
32
32
"Run `<cyan,bold>cargo help owner</>` for more detailed information.\n "
Original file line number Diff line number Diff line change @@ -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" ,
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ pub fn cli() -> Command {
15
15
)
16
16
. value_name ( "LIMIT" ) ,
17
17
)
18
- . arg_index ( )
19
- . arg ( opt ( "registry" , " Registry to use" ) . value_name ( "REGISTRY" ) )
18
+ . arg_index ( "Registry index URL to search packages in" )
19
+ . arg_registry ( " Registry to search packages in" )
20
20
. arg_quiet ( )
21
21
. after_help ( color_print:: cstr!(
22
22
"Run `<cyan,bold>cargo help search</>` for more detailed information.\n "
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ pub fn cli() -> Command {
16
16
"undo" ,
17
17
"Undo a yank, putting a version back into the index" ,
18
18
) )
19
- . arg ( opt ( "index" , " Registry index to yank from") . value_name ( "INDEX" ) )
20
- . arg ( opt ( "registry" , " Registry to use" ) . value_name ( "REGISTRY" ) )
19
+ . arg_index ( " Registry index URL to yank from")
20
+ . arg_registry ( " Registry to yank from" )
21
21
. arg ( opt ( "token" , "API token to use when authenticating" ) . value_name ( "TOKEN" ) )
22
22
. arg_quiet ( )
23
23
. after_help ( color_print:: cstr!(
Original file line number Diff line number Diff line change @@ -286,8 +286,12 @@ pub trait CommandExt: Sized {
286
286
)
287
287
}
288
288
289
- fn arg_index ( self ) -> Self {
290
- self . _arg ( opt ( "index" , "Registry index URL to upload the package to" ) . value_name ( "INDEX" ) )
289
+ fn arg_registry ( self , help : & ' static str ) -> Self {
290
+ self . _arg ( opt ( "registry" , help) . value_name ( "REGISTRY" ) )
291
+ }
292
+
293
+ fn arg_index ( self , help : & ' static str ) -> Self {
294
+ self . _arg ( opt ( "index" , help) . value_name ( "INDEX" ) )
291
295
}
292
296
293
297
fn arg_dry_run ( self , dry_run : & ' static str ) -> Self {
Original file line number Diff line number Diff line change 9
9
-a, --add <LOGIN> Name of a user or team to invite as an owner
10
10
-r, --remove <LOGIN> Name of a user or team to remove as an owner
11
11
-l, --list List owners of a crate
12
- --index <INDEX> Registry index to modify owners for
12
+ --index <INDEX> Registry index URL to modify owners for
13
+ --registry <REGISTRY> Registry to modify owners for
13
14
--token <TOKEN> API token to use when authenticating
14
- --registry <REGISTRY> Registry to use
15
15
-q, --quiet Do not print cargo log messages
16
16
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
17
17
--color <WHEN> Coloring: auto, always, never
You can’t perform that action at this time.
0 commit comments