Add aliases to doc markdown

This commit is contained in:
divolgin 2025-01-22 11:02:33 -08:00
parent 6c3c1163c6
commit ae35f9573b

View file

@ -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()))
}
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 {
buf.WriteString("### Examples\n\n")
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))