Skip to content
Open
Changes from all 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
12 changes: 8 additions & 4 deletions doc/md_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,19 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)

buf.WriteString("## " + name + "\n\n")
buf.WriteString(cmd.Short + "\n\n")
if len(cmd.Long) > 0 {
buf.WriteString("### Synopsis\n\n")
buf.WriteString(cmd.Long + "\n\n")
}

if cmd.Runnable() {
if len(cmd.Long) > 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would this only be printed if long > 0 now?

Copy link
Author

@adombeck adombeck Jan 5, 2026

Choose a reason for hiding this comment

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

That was already the case. The ### Synopsis section header was previously printed in line 67, which was only printed if len(cmd.Long) > 0.

buf.WriteString("### Synopsis\n\n")
}
fmt.Fprintf(buf, "```\n%s\n```\n\n", cmd.UseLine())
}

if len(cmd.Long) > 0 {
buf.WriteString("### Description\n\n")
buf.WriteString(cmd.Long + "\n\n")
}

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