Skip to content

Commit

Permalink
Print config beautifully
Browse files Browse the repository at this point in the history
  • Loading branch information
bahner committed Feb 28, 2024
1 parent 606ae13 commit 1334aa2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ func Init(configName string) error {

if viper.GetBool("show-config") {
configMap := viper.AllSettings()

// remove non-sensical values
delete(configMap, "version")
delete(configMap, "show-config")
delete(configMap, "show-defaults")
delete(configMap, "generate")
delete(configMap, "publish")

configYAML, err := yaml.Marshal(configMap)
if err != nil {
log.Fatalf("error: %v", err)
Expand Down

0 comments on commit 1334aa2

Please sign in to comment.