mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
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
1 changed files with 2 additions and 7 deletions
|
@ -549,14 +549,9 @@ func (c *Command) Execute() (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == flag.ErrHelp {
|
|
||||||
c.Help()
|
|
||||||
|
|
||||||
} else {
|
|
||||||
c.Println("Error:", err.Error())
|
c.Println("Error:", err.Error())
|
||||||
c.Printf("Run '%v help' for usage.\n", c.Root().Name())
|
c.Printf("Run '%v help' for usage.\n", c.Root().Name())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue