This commit is contained in:
namusyaka 2020-12-05 04:34:11 +09:00 committed by GitHub
parent 39b5a91b20
commit 7df62f7668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -964,13 +964,13 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
return cmd, nil return cmd, nil
} }
// If root command has SilentErrors flagged, // If root command has SilenceErrors flagged,
// all subcommands should respect it // all subcommands should respect it
if !cmd.SilenceErrors && !c.SilenceErrors { if !cmd.SilenceErrors && !c.SilenceErrors {
c.PrintErrln("Error:", err.Error()) c.PrintErrln("Error:", err.Error())
} }
// If root command has SilentUsage flagged, // If root command has SilenceUsage flagged,
// all subcommands should respect it // all subcommands should respect it
if !cmd.SilenceUsage && !c.SilenceUsage { if !cmd.SilenceUsage && !c.SilenceUsage {
c.Println(cmd.UsageString()) c.Println(cmd.UsageString())