2016-10-20 00:13:21 +00:00
|
|
|
package main
|
|
|
|
|
2017-03-16 10:14:02 +00:00
|
|
|
import "github.com/urfave/cli"
|
2016-10-20 00:13:21 +00:00
|
|
|
|
|
|
|
var globalSecretRemoveCmd = cli.Command{
|
2017-03-16 10:14:02 +00:00
|
|
|
Name: "rm",
|
|
|
|
Usage: "remove a secret",
|
|
|
|
Action: globalSecretRemove,
|
2016-10-20 00:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func globalSecretRemove(c *cli.Context) error {
|
|
|
|
if len(c.Args()) != 1 {
|
|
|
|
cli.ShowSubcommandHelp(c)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
secret := c.Args().First()
|
|
|
|
|
|
|
|
client, err := newClient(c)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return client.GlobalSecretDel(secret)
|
|
|
|
}
|