Skip to content

Commit

Permalink
Fix:(issue_1689) Let markdown output behave similar to cli help output
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Apr 17, 2023
1 parent c0cc5c2 commit 57cbb2d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,14 @@ func prepareFlags(
// flagDetails returns a string containing the flags metadata
func flagDetails(flag DocGenerationFlag) string {
description := flag.GetUsage()
value := flag.GetValue()
if value != "" {
description += " (default: " + value + ")"
if flag.TakesValue() {
defaultText := flag.GetDefaultText()
if defaultText == "" {
defaultText = flag.GetValue()
}
if defaultText != "" {
description += " (default: " + defaultText + ")"
}
}
return ": " + description
}
Expand Down

0 comments on commit 57cbb2d

Please sign in to comment.