Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/md_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ 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: ")
for i, alias := range cmd.Aliases {
if i > 0 {
buf.WriteString(", ")
}
buf.WriteString(fmt.Sprintf("`%s`", alias))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'm surprised by this syntax, that was already used in the file I concede

I feel like this would be more natural.

Note

This is more a note to myself to look deeper than something I expect you to change

This could have been used

Suggested change
buf.WriteString(fmt.Sprintf("`%s`", alias))
fmt.Fprintf(buf, "`%s`", alias)

@commit111 please look at this that seems a better option

#2271 (comment)

}
buf.WriteString("\n")
}

if len(cmd.Example) > 0 {
buf.WriteString("### Examples\n\n")
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
Expand Down