Skip to content

Commit

Permalink
fix #2 get command won't write anything on stdout f key is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaunet committed Jan 7, 2023
1 parent 6ac05b2 commit 3b4d2f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var getCmd = &cobra.Command{
os.Exit(1)
}

// Classic read of values, default section can be represented as empty string
fmt.Println(cfg.Section(section).Key(key).String())
if cfg.Section(section).HasKey(key) {
fmt.Println(cfg.Section(section).Key(key).String())
}
},
}

0 comments on commit 3b4d2f2

Please sign in to comment.