We used to do the equivalent of `rootCmd.SetOut(os.Stdout)` because we
thought that Cobra's "Out" stream represents standard output. However,
upon closer inspection it turns out that this is Cobra's stream for
usage errors and deprecation warnings, and those we want written to
stderr as well. It is not clear to me why Cobra maintains a distinction
between "Out" and "Err" streams since both seem to go to sdterr by
default.
This change also ceases our usage of `command.Print()` functions in
favor of explicitly writing to `IOStreams.Out/ErrOut`.
* Add "reference" help topic
* Only print reference as a help topic
* fix for color fns, slightly generalize
* WIP for switching to markdown
* escape gt/lt
* minor
* higher wrap point
* detect terminal theme
* futz with angle brackets once more
* minor cleanup
* prepend parent commands
* rename help topic fns and add test
* Simplify reference help generation
- the `<...>` characters from command usage line are now preserved by enclosing the entire usage synopsis in a code span
- hard breaks in flag usage lines are preserved by enclosing flag usage in a code block
- TTY detection and Markdown rendering are now delayed until the user explicitly requests `gh help reference`
- `gh help reference` output is now pager-enabled
Co-authored-by: vilmibm <vilmibm@github.com>
Co-authored-by: vilmibm <vilmibm@neongrid.space>
Co-authored-by: Mislav Marohnić <mislav@github.com>