@@ -6,15 +6,10 @@ use cargo_credential::Secret;
6
6
pub fn cli ( ) -> Command {
7
7
subcommand ( "owner" )
8
8
. about ( "Manage the owners of a crate on the registry" )
9
- . arg ( Arg :: new ( "crate" ) . hide ( true ) )
10
9
. arg_required_else_help ( true )
11
10
. args_conflicts_with_subcommands ( true )
12
- . override_usage (
13
- "\
14
- cargo[EXE] owner add <OWNER_NAME> [CRATE_NAME] [OPTIONS]
15
- cargo[EXE] owner remove <OWNER_NAME> [CRATE_NAME] [OPTIONS]
16
- cargo[EXE] owner list [CRATE_NAME] [OPTIONS]" ,
17
- )
11
+ . flatten_help ( true )
12
+ . arg ( Arg :: new ( "crate" ) . hide ( true ) )
18
13
. arg (
19
14
multi_opt (
20
15
"add" ,
@@ -37,41 +32,38 @@ pub fn cli() -> Command {
37
32
. subcommands ( [
38
33
Command :: new ( "add" )
39
34
. about ( "Name of a user or team to invite as an owner" )
40
- . args ( [
35
+ . arg (
41
36
Arg :: new ( "add" )
42
37
. required ( true )
43
38
. value_delimiter ( ',' )
44
39
. value_name ( "OWNER_NAME" )
45
- . help ( "Name of the owner you want to invite" ) ,
46
- Arg :: new ( "crate ")
47
- . value_name ( "CRATE_NAME" )
48
- . help ( "Crate name that you want to manage the owner" ) ,
49
- ] )
50
- . args ( & add_registry_args ( ) )
51
- . override_usage ( "cargo owner add <OWNER_NAME> [CRATE_NAME] [OPTIONS]" ) ,
40
+ . hide ( true )
41
+ . help ( "Name of the owner you want to invite ")
42
+ )
43
+ . args ( add_registry_args ( ) )
44
+ . override_usage ( color_print :: cstr! (
45
+ "<cyan,bold>cargo owner add <<OWNER_NAME>> [CRATE_NAME] [OPTIONS]</>"
46
+ ) ) ,
52
47
Command :: new ( "remove" )
53
48
. about ( "Name of a user or team to remove as an owner" )
54
- . args ( [
49
+ . arg (
55
50
Arg :: new ( "remove" )
56
51
. required ( true )
57
52
. value_delimiter ( ',' )
58
53
. value_name ( "OWNER_NAME" )
59
- . help ( "Name of the owner you want to remove" ) ,
60
- Arg :: new ( "crate ")
61
- . value_name ( "CRATE_NAME" )
62
- . help ( "Crate name that you want to manage the owner" ) ,
63
- ] )
64
- . args ( & add_registry_args ( ) )
65
- . override_usage ( "cargo owner remove <OWNER_NAME> [CRATE_NAME] [OPTIONS]" ) ,
54
+ . hide ( true )
55
+ . help ( "Name of the owner you want to remove ")
56
+ )
57
+ . args ( add_registry_args ( ) )
58
+ . override_usage ( color_print :: cstr! (
59
+ "<cyan,bold>cargo owner remove <<OWNER_NAME>> [CRATE_NAME] [OPTIONS]</>"
60
+ ) ) ,
66
61
Command :: new ( "list" )
67
62
. about ( "List owners of a crate" )
68
- . arg (
69
- Arg :: new ( "crate" )
70
- . value_name ( "CRATE_NAME" )
71
- . help ( "Crate name which you want to list all owner names" ) ,
72
- )
73
- . args ( & add_registry_args ( ) )
74
- . override_usage ( "cargo owner list [CRATE_NAME] [OPTIONS]" ) ,
63
+ . args ( add_registry_args ( ) )
64
+ . override_usage ( color_print:: cstr!(
65
+ "<cyan,bold>cargo owner list [CRATE_NAME] [OPTIONS]</>"
66
+ ) ) ,
75
67
] )
76
68
. arg_index ( "Registry index URL to modify owners for" )
77
69
. arg_registry ( "Registry to modify owners for" )
@@ -82,8 +74,10 @@ pub fn cli() -> Command {
82
74
) )
83
75
}
84
76
85
- fn add_registry_args ( ) -> [ Arg ; 3 ] {
77
+ fn add_registry_args ( ) -> [ Arg ; 4 ] {
86
78
[
79
+ opt ( "crate" , "Crate name that you want to manage the owner" )
80
+ . value_name ( "CRATE_NAME" ) ,
87
81
opt ( "index" , "Registry index URL to modify owners for" )
88
82
. value_name ( "INDEX" )
89
83
. conflicts_with ( "registry" ) ,
0 commit comments