adds inheritance for SilenceErrors

This commit is contained in:
Austin Riendeau 2015-10-25 21:17:39 -06:00
parent f6e1a2df92
commit 03aabcda72

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