Skip to content

Commit 57cbb2d

Browse files
committed
Fix:(issue_1689) Let markdown output behave similar to cli help output
1 parent c0cc5c2 commit 57cbb2d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,14 @@ func prepareFlags(
153153
// flagDetails returns a string containing the flags metadata
154154
func flagDetails(flag DocGenerationFlag) string {
155155
description := flag.GetUsage()
156-
value := flag.GetValue()
157-
if value != "" {
158-
description += " (default: " + value + ")"
156+
if flag.TakesValue() {
157+
defaultText := flag.GetDefaultText()
158+
if defaultText == "" {
159+
defaultText = flag.GetValue()
160+
}
161+
if defaultText != "" {
162+
description += " (default: " + defaultText + ")"
163+
}
159164
}
160165
return ": " + description
161166
}

0 commit comments

Comments
 (0)