From 14ab4f65f90a3d358716f4a313675de34db11c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Mej=C3=ADas=20Rodr=C3=ADguez?= Date: Fri, 9 Aug 2019 13:37:04 -0400 Subject: [PATCH] Remove -q, --quiet flag from stack list command The same result can be achieved with --format flag, which provides greater flexibility: ./psu stack ls --format "{{ .Name }}" --- cmd/stackList.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/stackList.go b/cmd/stackList.go index 4daca1c..7a3b022 100644 --- a/cmd/stackList.go +++ b/cmd/stackList.go @@ -55,13 +55,7 @@ var stackListCmd = &cobra.Command{ common.CheckError(err) } - if viper.GetBool("stack.list.quiet") { - // Print only stack names - for _, s := range stacks { - _, err := fmt.Println(s.Name) - common.CheckError(err) - } - } else if viper.GetString("stack.list.format") != "" { + if viper.GetString("stack.list.format") != "" { // Print stack fields formatted template, templateParsingErr := template.New("stackTpl").Parse(viper.GetString("stack.list.format")) common.CheckError(templateParsingErr) @@ -99,9 +93,7 @@ func init() { stackCmd.AddCommand(stackListCmd) stackListCmd.Flags().Uint32("endpoint", 0, "Filter by endpoint ID.") - stackListCmd.Flags().BoolP("quiet", "q", false, "Only display stack names.") stackListCmd.Flags().String("format", "", "Format output using a Go template.") viper.BindPFlag("stack.list.endpoint", stackListCmd.Flags().Lookup("endpoint")) - viper.BindPFlag("stack.list.quiet", stackListCmd.Flags().Lookup("quiet")) viper.BindPFlag("stack.list.format", stackListCmd.Flags().Lookup("format")) }