diff --git a/cli/cobra.go b/cli/cobra.go index 0341f075d2..34563669b6 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -234,9 +234,13 @@ func isExperimental(cmd *cobra.Command) bool { } func additionalHelp(cmd *cobra.Command) string { - if additionalHelp, ok := cmd.Annotations["additionalHelp"]; ok { + if msg, ok := cmd.Annotations["additionalHelp"]; ok { + out := cmd.OutOrStderr() + if _, isTerminal := term.GetFdInfo(out); !isTerminal { + return msg + } style := aec.EmptyBuilder.Bold().ANSI - return style.Apply(additionalHelp) + return style.Apply(msg) } return "" }