From 2244c3923a93b045f65a3a56172ce48100baa50e Mon Sep 17 00:00:00 2001 From: Austin Riendeau Date: Mon, 26 Oct 2015 17:42:06 -0600 Subject: [PATCH] [silence-errors]: adds comments around code --- command.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/command.go b/command.go index 6d1f56e0..f0587f9b 100644 --- a/command.go +++ b/command.go @@ -639,10 +639,13 @@ func (c *Command) Execute() (err error) { err = cmd.execute(flags) if err != nil { - // If root is silenced, all subcommands should have the same + // If root command has SilentUsage flagged, + // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) } + // If root command has SilentErrors flagged, + // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { if err == flag.ErrHelp { cmd.HelpFunc()(cmd, args)