Skip to content
Myr

always show help if requested, even if SilenceErrors is enabled

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sascha Holzleiter · committed by Steve Francia · parent c65e642 · Browse files · 1 file+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−4 removed

  • other:+7 added−4 removed

1 file+7 added−4 removed

modified:command.go+7 added-4 removed
653 unmodified lines
654 return c, err655 }656 err = cmd.execute(flags)657 if err != nil {658 // Always show help if requested, even if SilenceErrors is in659 // effect660 if err == flag.ErrHelp {661 cmd.HelpFunc()(cmd, args)662 return cmd, nil663 }664665 // If root command has SilentErrors flagged,666 // all subcommands should respect it667 if !cmd.SilenceErrors && !c.SilenceErrors {661 if err == flag.ErrHelp {662 cmd.HelpFunc()(cmd, args)663 return cmd, nil664 }668 c.Println("Error:", err.Error())669 }670671 // If root command has SilentUsage flagged,
526 unmodified lines