Remove config list --keys flag

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-09 15:43:21 -04:00
parent 3f788efff5
commit feae59a058
2 changed files with 2 additions and 11 deletions

View File

@ -2,7 +2,6 @@ FROM alpine:3
ENV PSU_AUTH_TOKEN="" \
PSU_CONFIG="" \
PSU_CONFIG_LIST_KEYS="" \
PSU_ENDPOINT_GROUP_LIST_FORMAT="" \
PSU_ENDPOINT_LIST_FORMAT="" \
PSU_INSECURE="" \

View File

@ -22,20 +22,12 @@ var configListCmd = &cobra.Command{
})
for _, key := range keys {
if viper.GetBool("config.list.keys") {
// List config key
fmt.Println(key)
} else {
// List config key and value
fmt.Printf("%s: %v\n", key, viper.Get(key))
}
// List config key and value
fmt.Printf("%s: %v\n", key, viper.Get(key))
}
},
}
func init() {
configCmd.AddCommand(configListCmd)
configListCmd.Flags().Bool("keys", false, "Only list keys.")
viper.BindPFlag("config.list.keys", configListCmd.Flags().Lookup("keys"))
}