From ae35f9573b05e625542bdaf23a0247a435d6d89f Mon Sep 17 00:00:00 2001 From: divolgin Date: Wed, 22 Jan 2025 11:02:33 -0800 Subject: [PATCH] Add aliases to doc markdown --- doc/md_docs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/md_docs.go b/doc/md_docs.go index 1259222..39b62ba 100644 --- a/doc/md_docs.go +++ b/doc/md_docs.go @@ -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))