adds inheritance for SilenceErrors

This commit is contained in:
Austin Riendeau 2015-10-25 21:17:39 -06:00
parent f6e1a2df92
commit 03aabcda72
1 changed files with 2 additions and 1 deletions

View File

@ -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