Fix Cobra completion output going to stdout

This commit is contained in:
Mislav Marohnić 2022-05-25 14:57:47 +02:00
parent ec12d27db5
commit 7859afb586

View file

@ -57,8 +57,8 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
},
}
cmd.SetOut(f.IOStreams.ErrOut) // command usage summary and deprecation warnings
cmd.SetErr(f.IOStreams.ErrOut) // error messages
// cmd.SetOut(f.IOStreams.Out) // can't use due to https://github.com/spf13/cobra/issues/1708
// cmd.SetErr(f.IOStreams.ErrOut) // just let it default to os.Stderr instead
cmd.Flags().Bool("version", false, "Show gh version")
cmd.PersistentFlags().Bool("help", false, "Show help for command")