@@ -8,19 +8,19 @@ import (
8
8
"cdr.dev/coder-cli/internal/entclient"
9
9
"cdr.dev/coder-cli/internal/x/xtabwriter"
10
10
"github.com/manifoldco/promptui"
11
- "github.com/urfave/cli"
11
+ "github.com/urfave/cli/v2 "
12
12
"golang.org/x/xerrors"
13
13
14
14
"go.coder.com/flog"
15
15
)
16
16
17
- func makeSecretsCmd () cli.Command {
18
- return cli.Command {
17
+ func makeSecretsCmd () * cli.Command {
18
+ return & cli.Command {
19
19
Name : "secrets" ,
20
20
Usage : "Interact with Coder Secrets" ,
21
21
Description : "Interact with secrets objects owned by the active user." ,
22
22
Action : exitHelp ,
23
- Subcommands : []cli.Command {
23
+ Subcommands : []* cli.Command {
24
24
{
25
25
Name : "ls" ,
26
26
Usage : "List all secrets owned by the active user" ,
@@ -43,15 +43,15 @@ func makeSecretsCmd() cli.Command {
43
43
}
44
44
}
45
45
46
- func makeCreateSecret () cli.Command {
46
+ func makeCreateSecret () * cli.Command {
47
47
var (
48
48
fromFile string
49
49
fromLiteral string
50
50
fromPrompt bool
51
51
description string
52
52
)
53
53
54
- return cli.Command {
54
+ return & cli.Command {
55
55
Name : "create" ,
56
56
Usage : "Create a new secret" ,
57
57
Description : "Create a new secret object to store application secrets and access them securely from within your environments." ,
@@ -114,23 +114,23 @@ func makeCreateSecret() cli.Command {
114
114
return nil
115
115
},
116
116
Flags : []cli.Flag {
117
- cli.StringFlag {
117
+ & cli.StringFlag {
118
118
Name : "from-file" ,
119
119
Usage : "a file from which to read the value of the secret" ,
120
120
TakesFile : true ,
121
121
Destination : & fromFile ,
122
122
},
123
- cli.StringFlag {
123
+ & cli.StringFlag {
124
124
Name : "from-literal" ,
125
125
Usage : "the value of the secret" ,
126
126
Destination : & fromLiteral ,
127
127
},
128
- cli.BoolFlag {
128
+ & cli.BoolFlag {
129
129
Name : "from-prompt" ,
130
130
Usage : "enter the secret value through a terminal prompt" ,
131
131
Destination : & fromPrompt ,
132
132
},
133
- cli.StringFlag {
133
+ & cli.StringFlag {
134
134
Name : "description" ,
135
135
Usage : "a description of the secret" ,
136
136
Destination : & description ,
@@ -197,10 +197,10 @@ func removeSecrets(c *cli.Context) error {
197
197
for _ , n := range names {
198
198
err := client .DeleteSecretByName (n )
199
199
if err != nil {
200
- flog .Error ("Failed to delete secret: %v" , err )
200
+ flog .Error ("failed to delete secret %q : %v" , n , err )
201
201
errorSeen = true
202
202
} else {
203
- flog .Info ( "Successfully deleted secret %q" , n )
203
+ flog .Success ( "successfully deleted secret %q" , n )
204
204
}
205
205
}
206
206
if errorSeen {
0 commit comments