forked from mirror/cobra
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,14 +549,9 @@ 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())
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue