From f100ed021f08cc2c7e7a9c2eba78f3518c11e47d Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Thu, 17 Jun 2021 14:03:36 -0500 Subject: [PATCH] chore: clean up main and reorg the commands Signed-off-by: Derek Smith --- main.go | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/main.go b/main.go index 5887a60..7d8b09e 100644 --- a/main.go +++ b/main.go @@ -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", @@ -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