The default pflag error is to only print the bad flag. This enables an application
to include a usage message or other details about the error.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This code was already using io.Writer, but was completely ignoring write
errors.
The most worrying part is how GenMarkdownTreeCustom used an unnecessary
buffer to then dump all of its contents on a file, and instead of
returning an error on file creation/writing, it would just exit the
entire program.
* Move man_docs and md_docs into new doc pkg
* Replace *bytes.Buffer with io.Writer
* Replace c == cmd.helpCommand with c.IsHelpCommand()
* Remove redundant len(children) == 0 check in HasSeeAlso
* Duplicate test setup for doc generation