Hide the pflag error when displaying help.

This commit is contained in:
Ludovic Fernandez 2018-02-05 09:12:03 +01:00 committed by Traefiker
parent be4aeaacde
commit 203a5c5c48

View file

@ -28,6 +28,7 @@ import (
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/containous/traefik/version" "github.com/containous/traefik/version"
"github.com/coreos/go-systemd/daemon" "github.com/coreos/go-systemd/daemon"
"github.com/ogier/pflag"
) )
func main() { func main() {
@ -75,6 +76,9 @@ Complete documentation is available at https://traefik.io`,
} }
if _, err := f.Parse(usedCmd); err != nil { if _, err := f.Parse(usedCmd); err != nil {
if err == pflag.ErrHelp {
os.Exit(0)
}
fmtlog.Printf("Error parsing command: %s\n", err) fmtlog.Printf("Error parsing command: %s\n", err)
os.Exit(-1) os.Exit(-1)
} }