mirror of
https://github.com/spf13/cobra
synced 2025-01-30 15:36:47 +00:00
Add aliases to doc markdown
This commit is contained in:
parent
6c3c1163c6
commit
ae35f9573b
1 changed files with 5 additions and 0 deletions
|
@ -72,6 +72,11 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
|
||||||
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine()))
|
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(cmd.Aliases) > 0 {
|
||||||
|
buf.WriteString("### Aliases\n\n")
|
||||||
|
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.NameAndAliases()))
|
||||||
|
}
|
||||||
|
|
||||||
if len(cmd.Example) > 0 {
|
if len(cmd.Example) > 0 {
|
||||||
buf.WriteString("### Examples\n\n")
|
buf.WriteString("### Examples\n\n")
|
||||||
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
|
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
|
||||||
|
|
Loading…
Reference in a new issue