Skip to content
Myr

doc: Ad help flag and cmd when generating docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Albert Nigmatzianov · committed by Albert Nigmatzianov · parent 52ae6a1 · Browse files · 3 files+9 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+9 added−0 removed

  • other:+9 added−0 removed

3 files+9 added−0 removed

modified:doc/man_docs.go+3 added
188 unmodified lines
189 }190}191192func genMan(cmd *cobra.Command, header *GenManHeader) []byte {193 cmd.InitDefaultHelpCmd()194 cmd.InitDefaultHelpFlag()195196 // something like `rootcmd-subcmd1-subcmd2`197 dashCommandName := strings.Replace(cmd.CommandPath(), " ", "-", -1)198199 buf := new(bytes.Buffer)
37 unmodified lines
modified:doc/md_docs.go+3 added
50 unmodified lines
51}5253// GenMarkdownCustom creates custom markdown output.54func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error {55 cmd.InitDefaultHelpCmd()56 cmd.InitDefaultHelpFlag()5758 buf := new(bytes.Buffer)59 name := cmd.CommandPath()6061 short := cmd.Short
98 unmodified lines
modified:doc/yaml_docs.go+3 added
87 unmodified lines
88}8990// GenYamlCustom creates custom yaml output.91func GenYamlCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error {92 cmd.InitDefaultHelpCmd()93 cmd.InitDefaultHelpFlag()9495 yamlDoc := cmdDoc{}96 yamlDoc.Name = cmd.CommandPath()9798 yamlDoc.Synopsis = forceMultiLine(cmd.Short)
71 unmodified lines