mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
adds inheritance for SilenceErrors
This commit is contained in:
parent
f6e1a2df92
commit
03aabcda72
1 changed files with 2 additions and 1 deletions
|
@ -637,7 +637,8 @@ func (c *Command) Execute() (err error) {
|
|||
|
||||
err = cmd.execute(flags)
|
||||
if err != nil {
|
||||
if !cmd.SilenceErrors {
|
||||
// If root is silenced, all subcommands should have the same
|
||||
if !cmd.SilenceErrors && !c.SilenceErrors {
|
||||
if err == flag.ErrHelp {
|
||||
cmd.HelpFunc()(cmd, args)
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue