Write cli errors to stderr

This explicitly writes errors to stderr, for the benefit of the
document plugin subcommand.  This is needed so that errors are displayed
to end users of kustomize, and can be used to debug manifest issues.
When sent to stdout, the error message gets swallowed/hidden by kustomize.

Change-Id: I49b668e5e71fbe4662fe3aec7bad4ebccadebd64
This commit is contained in:
Matt McEuen 2020-05-11 13:43:14 -05:00
parent 936b5639f5
commit 86f3b9ffc7

View File

@ -29,7 +29,7 @@ func main() {
} }
if err := rootCmd.Execute(); err != nil { if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stdout, err) fmt.Fprintln(os.Stderr, err)
os.Exit(1) os.Exit(1)
} }
} }