20
20
_ cli.ParentCommand = secretsCmd {}
21
21
22
22
_ cli.FlaggedCommand = & listSecretsCmd {}
23
- _ cli.FlaggedCommand = & addSecretCmd {}
23
+ _ cli.FlaggedCommand = & createSecretCmd {}
24
24
)
25
25
26
26
type secretsCmd struct {
@@ -44,7 +44,7 @@ func (cmd secretsCmd) Subcommands() []cli.Command {
44
44
return []cli.Command {
45
45
& listSecretsCmd {},
46
46
& viewSecretsCmd {},
47
- & addSecretCmd {},
47
+ & createSecretCmd {},
48
48
& deleteSecretsCmd {},
49
49
}
50
50
}
@@ -110,11 +110,11 @@ func (cmd viewSecretsCmd) Run(fl *pflag.FlagSet) {
110
110
requireSuccess (err , "failed to write: %v" , err )
111
111
}
112
112
113
- type addSecretCmd struct {
113
+ type createSecretCmd struct {
114
114
name , value , description string
115
115
}
116
116
117
- func (cmd * addSecretCmd ) Validate () (e []error ) {
117
+ func (cmd * createSecretCmd ) Validate () (e []error ) {
118
118
if cmd .name == "" {
119
119
e = append (e , xerrors .New ("--name is a required flag" ))
120
120
}
@@ -124,15 +124,15 @@ func (cmd *addSecretCmd) Validate() (e []error) {
124
124
return e
125
125
}
126
126
127
- func (cmd * addSecretCmd ) Spec () cli.CommandSpec {
127
+ func (cmd * createSecretCmd ) Spec () cli.CommandSpec {
128
128
return cli.CommandSpec {
129
- Name : "add " ,
129
+ Name : "create " ,
130
130
Usage : `--name MYSQL_KEY --value 123456 --description "MySQL credential for database access"` ,
131
131
Desc : "insert a new secret" ,
132
132
}
133
133
}
134
134
135
- func (cmd * addSecretCmd ) Run (fl * pflag.FlagSet ) {
135
+ func (cmd * createSecretCmd ) Run (fl * pflag.FlagSet ) {
136
136
var (
137
137
client = requireAuth ()
138
138
)
@@ -146,7 +146,7 @@ func (cmd *addSecretCmd) Run(fl *pflag.FlagSet) {
146
146
requireSuccess (err , "failed to insert secret: %v" , err )
147
147
}
148
148
149
- func (cmd * addSecretCmd ) RegisterFlags (fl * pflag.FlagSet ) {
149
+ func (cmd * createSecretCmd ) RegisterFlags (fl * pflag.FlagSet ) {
150
150
fl .StringVar (& cmd .name , "name" , "" , "the name of the secret" )
151
151
fl .StringVar (& cmd .value , "value" , "" , "the value of the secret" )
152
152
fl .StringVar (& cmd .description , "description" , "" , "a description of the secret" )
0 commit comments