Skip to content

Commit

Permalink
Revert change so help is printed on stdout again (#1004)
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 <[email protected]>
  • Loading branch information
marckhouzam authored and eparis committed Dec 23, 2019
1 parent b04b5bf commit 0d9d2d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion command.go
Original file line number Diff line number Diff line change
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 0d9d2d4

Please sign in to comment.