Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6 from cxhercules/master
Browse files Browse the repository at this point in the history
Allow help to exit with status code 0
  • Loading branch information
krishicks committed Oct 5, 2017
2 parents 83cc9ac + dffb1ec commit fd54774
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/yaml-patch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ type opts struct {
func main() {
var o opts
_, err := flags.Parse(&o)

if err != nil {
log.Fatalf("error: %s\n", err)
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
os.Exit(0)
} else {
log.Fatalf("error: %s\n", err)
os.Exit(1)
}
}

placeholderWrapper := yamlpatch.NewPlaceholderWrapper("{{", "}}")
Expand Down

0 comments on commit fd54774

Please sign in to comment.