Remove unused ErrHelp check

Inside Command.Execute() we were checking for pflag.ErrHelp. But
Command.execute() never returns that value. It just complicates the code
and isn't used.
This commit is contained in:
Eric Paris 2015-06-09 15:16:44 -04:00
parent 0a1a8e2e92
commit 6f735782e0

View file

@ -549,13 +549,8 @@ func (c *Command) Execute() (err error) {
}
if err != nil {
if err == flag.ErrHelp {
c.Help()
} else {
c.Println("Error:", err.Error())
c.Printf("Run '%v help' for usage.\n", c.Root().Name())
}
c.Println("Error:", err.Error())
c.Printf("Run '%v help' for usage.\n", c.Root().Name())
}
return