Skip to content

Commit

Permalink
Revert change so help is printed on stdout again
Browse files Browse the repository at this point in the history
Fixes #1002
For backwards compatibility reasons, and to follow the need of
kubernetes/kubernetes#26077 (comment)
the help message should be printed on stdout.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
  • Loading branch information
marckhouzam committed Dec 22, 2019
1 parent b04b5bf commit aa2cd0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion command.go
Expand Up @@ -372,7 +372,9 @@ func (c *Command) HelpFunc() func(*Command, []string) {
}
return func(c *Command, a []string) {
c.mergePersistentFlags()
err := tmpl(c.OutOrStderr(), c.HelpTemplate(), c)
// The help should be sent to stdout
// See https://github.com/spf13/cobra/issues/1002
err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c)
if err != nil {
c.Println(err)
}
Expand Down

0 comments on commit aa2cd0c

Please sign in to comment.