Skip to content

Commit

Permalink
chore: clean up main and reorg the commands
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Smith <derek@clokwork.net>
  • Loading branch information
clok committed Jun 17, 2021
1 parent 6be1284 commit f100ed0
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions main.go
Expand Up @@ -30,38 +30,15 @@ func main() {
Version: version,
Compiled: time.Now(),
Authors: []*cli.Author{
{
Name: "Derek Smith",
Email: "derek@clokwork.net",
},
{
Name: info.AppRepoOwner,
},
},
Copyright: "(c) 2021 Derek Smith",
HelpName: info.AppName,
Usage: "interact with config map and secret manager variables",
Usage: "AWS Secrets Manager CLI Tool",
EnableBashCompletion: true,
Commands: []*cli.Command{
{
// list-secrets
Name: "list",
Usage: "display table of all secrets with meta data",
Action: cmd.ListSecrets,
},
{
// describe-secret
Name: "describe",
Usage: "print description of secret to `STDOUT`",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "secret-id",
Aliases: []string{"s"},
Usage: "Specific Secret to describe, will bypass select/search",
},
},
Action: cmd.DescribeSecret,
},
{
// get-secret-value
Name: "get",
Expand Down Expand Up @@ -203,11 +180,31 @@ with AWSPREVIOUS.
},
Action: cmd.DeleteSecret,
},
{
// list-secrets
Name: "list",
Usage: "display table of all secrets with meta data",
Action: cmd.ListSecrets,
},
{
// describe-secret
Name: "describe",
Usage: "print description of secret to `STDOUT`",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "secret-id",
Aliases: []string{"s"},
Usage: "Specific Secret to describe, will bypass select/search",
},
},
Action: cmd.DescribeSecret,
},
im,
{
Name: "version",
Aliases: []string{"v"},
Usage: "Print version info",
Hidden: true,
Action: func(c *cli.Context) error {
fmt.Printf("%s %s (%s/%s)\n", info.AppName, version, runtime.GOOS, runtime.GOARCH)
return nil
Expand Down

0 comments on commit f100ed0

Please sign in to comment.