@@ -14,7 +14,7 @@ import (
14
14
"cdr.dev/coder-cli/internal/x/xtabwriter"
15
15
)
16
16
17
- func makeSecretsCmd () * cobra.Command {
17
+ func secretsCmd () * cobra.Command {
18
18
var user string
19
19
cmd := & cobra.Command {
20
20
Use : "secrets" ,
@@ -26,28 +26,28 @@ func makeSecretsCmd() *cobra.Command {
26
26
& cobra.Command {
27
27
Use : "ls" ,
28
28
Short : "List all secrets owned by the active user" ,
29
- RunE : listSecrets (& user ),
29
+ RunE : listSecretsCmd (& user ),
30
30
},
31
- makeCreateSecret (& user ),
31
+ createSecretCmd (& user ),
32
32
& cobra.Command {
33
33
Use : "rm [...secret_name]" ,
34
34
Short : "Remove one or more secrets by name" ,
35
35
Args : cobra .MinimumNArgs (1 ),
36
- RunE : makeRemoveSecrets (& user ),
36
+ RunE : removeSecretsCmd (& user ),
37
37
Example : "coder secrets rm mysql-password mysql-user" ,
38
38
},
39
39
& cobra.Command {
40
40
Use : "view [secret_name]" ,
41
41
Short : "View a secret by name" ,
42
42
Args : cobra .ExactArgs (1 ),
43
- RunE : makeViewSecret (& user ),
43
+ RunE : viewSecretCmd (& user ),
44
44
Example : "coder secrets view mysql-password" ,
45
45
},
46
46
)
47
47
return cmd
48
48
}
49
49
50
- func makeCreateSecret (userEmail * string ) * cobra.Command {
50
+ func createSecretCmd (userEmail * string ) * cobra.Command {
51
51
var (
52
52
fromFile string
53
53
fromLiteral string
@@ -136,7 +136,7 @@ coder secrets create aws-credentials --from-file ./credentials.json`,
136
136
return cmd
137
137
}
138
138
139
- func listSecrets (userEmail * string ) func (cmd * cobra.Command , _ []string ) error {
139
+ func listSecretsCmd (userEmail * string ) func (cmd * cobra.Command , _ []string ) error {
140
140
return func (cmd * cobra.Command , _ []string ) error {
141
141
client , err := newClient ()
142
142
if err != nil {
@@ -169,7 +169,7 @@ func listSecrets(userEmail *string) func(cmd *cobra.Command, _ []string) error {
169
169
}
170
170
}
171
171
172
- func makeViewSecret (userEmail * string ) func (cmd * cobra.Command , args []string ) error {
172
+ func viewSecretCmd (userEmail * string ) func (cmd * cobra.Command , args []string ) error {
173
173
return func (cmd * cobra.Command , args []string ) error {
174
174
var (
175
175
name = args [0 ]
@@ -196,7 +196,7 @@ func makeViewSecret(userEmail *string) func(cmd *cobra.Command, args []string) e
196
196
}
197
197
}
198
198
199
- func makeRemoveSecrets (userEmail * string ) func (c * cobra.Command , args []string ) error {
199
+ func removeSecretsCmd (userEmail * string ) func (c * cobra.Command , args []string ) error {
200
200
return func (cmd * cobra.Command , args []string ) error {
201
201
client , err := newClient ()
202
202
if err != nil {
0 commit comments