mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Remove config list --keys flag
This commit is contained in:
parent
3f788efff5
commit
feae59a058
@ -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="" \
|
||||
|
@ -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"))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user