woodpecker/drone/secret_list.go

33 lines
507 B
Go
Raw Normal View History

package main
2017-03-16 10:14:02 +00:00
import "github.com/urfave/cli"
var secretListCmd = cli.Command{
2017-03-16 10:14:02 +00:00
Name: "ls",
Usage: "list all secrets",
Action: secretList,
Flags: secretListFlags(),
}
func secretList(c *cli.Context) error {
owner, name, err := parseRepo(c.Args().First())
if err != nil {
return err
}
client, err := newClient(c)
if err != nil {
return err
}
secrets, err := client.SecretList(owner, name)
if err != nil || len(secrets) == 0 {
return err
}
2016-10-20 00:13:21 +00:00
return secretDisplayList(secrets, c)
}