Hide the pflag error when displaying help.
This commit is contained in:
parent
be4aeaacde
commit
203a5c5c48
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue