woodpecker/drone/global_secret_list.go

26 lines
435 B
Go
Raw Normal View History

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 globalSecretListCmd = cli.Command{
2017-03-16 10:14:02 +00:00
Name: "ls",
Usage: "list all secrets",
Action: globalSecretList,
Flags: secretListFlags(),
2016-10-20 00:13:21 +00:00
}
func globalSecretList(c *cli.Context) error {
client, err := newClient(c)
if err != nil {
return err
}
secrets, err := client.GlobalSecretList()
if err != nil || len(secrets) == 0 {
return err
}
return secretDisplayList(secrets, c)
}