Skip to content

Commit

Permalink
fix: handle flag.ErrHelp
Browse files Browse the repository at this point in the history
  • Loading branch information
tmzane committed Sep 9, 2023
1 parent 27b5488 commit e629585
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func run() (err error) {
fs := flag.NewFlagSet("slog-gen", flag.ContinueOnError)
fs.StringVar(&cfgPath, "config", ".slog.yml", "path to config")
if err := fs.Parse(os.Args[1:]); err != nil {
if errors.Is(err, flag.ErrHelp) {
return nil
}
return fmt.Errorf("parsing flags: %w", err)
}

Expand Down

0 comments on commit e629585

Please sign in to comment.