From 203a5c5c4830517d08eb04f8630d625c670c58b2 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 5 Feb 2018 09:12:03 +0100 Subject: [PATCH] Hide the pflag error when displaying help. --- cmd/traefik/traefik.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/traefik/traefik.go b/cmd/traefik/traefik.go index cdd6e5ad4..a6c403acd 100644 --- a/cmd/traefik/traefik.go +++ b/cmd/traefik/traefik.go @@ -28,6 +28,7 @@ import ( "github.com/containous/traefik/types" "github.com/containous/traefik/version" "github.com/coreos/go-systemd/daemon" + "github.com/ogier/pflag" ) func main() { @@ -75,6 +76,9 @@ Complete documentation is available at https://traefik.io`, } if _, err := f.Parse(usedCmd); err != nil { + if err == pflag.ErrHelp { + os.Exit(0) + } fmtlog.Printf("Error parsing command: %s\n", err) os.Exit(-1) }