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:
parent
0a1a8e2e92
commit
6f735782e0
@ -549,13 +549,8 @@ func (c *Command) Execute() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == flag.ErrHelp {
|
c.Println("Error:", err.Error())
|
||||||
c.Help()
|
c.Printf("Run '%v help' for usage.\n", c.Root().Name())
|
||||||
|
|
||||||
} else {
|
|
||||||
c.Println("Error:", err.Error())
|
|
||||||
c.Printf("Run '%v help' for usage.\n", c.Root().Name())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user