@@ -16,8 +16,6 @@ pub fn cli() -> Command {
16
16
cargo owner remove <OWNER_NAME> [CRATE_NAME] [OPTIONS]
17
17
cargo owner list [CRATE_NAME] [OPTIONS]" ,
18
18
)
19
- // The following three parameters are planned to be replaced in the form of subcommands.
20
- // refer to issue: https://github.com/rust-lang/cargo/issues/4352
21
19
. arg (
22
20
multi_opt (
23
21
"add" ,
@@ -38,10 +36,9 @@ pub fn cli() -> Command {
38
36
)
39
37
. arg ( flag ( "list" , "List owners of a crate" ) . short ( 'l' ) . hide ( true ) )
40
38
. subcommands ( [
41
- for_subcommand_add_arg (
39
+ add_registry_args (
42
40
Command :: new ( "add" )
43
41
. about ( "Name of a user or team to invite as an owner" )
44
- . arg_quiet ( )
45
42
. args ( [
46
43
Arg :: new ( "add" )
47
44
. required ( true )
@@ -52,11 +49,11 @@ pub fn cli() -> Command {
52
49
. value_name ( "CRATE_NAME" )
53
50
. help ( "Crate name that you want to manage the owner" ) ,
54
51
] ) ,
55
- ) ,
56
- for_subcommand_add_arg (
52
+ )
53
+ . override_usage ( "cargo owner add <OWNER_NAME> [CRATE_NAME] [OPTIONS]" ) ,
54
+ add_registry_args (
57
55
Command :: new ( "remove" )
58
56
. about ( "Name of a user or team to remove as an owner" )
59
- . arg_quiet ( )
60
57
. args ( [
61
58
Arg :: new ( "remove" )
62
59
. required ( true )
@@ -67,17 +64,16 @@ pub fn cli() -> Command {
67
64
. value_name ( "CRATE_NAME" )
68
65
. help ( "Crate name that you want to manage the owner" ) ,
69
66
] ) ,
70
- ) ,
71
- for_subcommand_add_arg (
72
- Command :: new ( "list" )
73
- . about ( "List owners of a crate" )
74
- . arg_quiet ( )
75
- . arg (
76
- Arg :: new ( "crate" )
77
- . value_name ( "CRATE_NAME" )
78
- . help ( "Crate name which you want to list all owner names" ) ,
79
- ) ,
80
- ) ,
67
+ )
68
+ . override_usage ( "cargo owner remove <OWNER_NAME> [CRATE_NAME] [OPTIONS]" ) ,
69
+ add_registry_args (
70
+ Command :: new ( "list" ) . about ( "List owners of a crate" ) . arg (
71
+ Arg :: new ( "crate" )
72
+ . value_name ( "CRATE_NAME" )
73
+ . help ( "Crate name which you want to list all owner names" ) ,
74
+ ) ,
75
+ )
76
+ . override_usage ( "cargo owner list [CRATE_NAME] [OPTIONS]" ) ,
81
77
] )
82
78
. arg_index ( "Registry index URL to modify owners for" )
83
79
. arg_registry ( "Registry to modify owners for" )
@@ -87,7 +83,7 @@ pub fn cli() -> Command {
87
83
) )
88
84
}
89
85
90
- fn for_subcommand_add_arg ( command : Command ) -> Command {
86
+ fn add_registry_args ( command : Command ) -> Command {
91
87
command
92
88
. arg_index ( "Registry index URL to modify owners for" )
93
89
. arg_registry ( "Registry to modify owners for" )
0 commit comments