Skip to content

Commit

Permalink
do not panic on --help
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Vasilev committed Aug 1, 2017
1 parent 61c6536 commit d7dc7e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ func initSignals(s *Supervisor) {
func main() {
var options Options
var parser = flags.NewParser(&options, flags.Default)
parser.Parse()
if _, err := parser.Parse(); err != nil {
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
os.Exit(0)
}
}
s := NewSupervisor(options.Configuration)
initSignals(s)
if err := s.Reload(); err != nil {
Expand Down

0 comments on commit d7dc7e0

Please sign in to comment.