We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b18accb commit 5040723Copy full SHA for 5040723
mango.go
@@ -22,6 +22,7 @@ type Command struct {
22
Name string
23
Short string
24
Usage string
25
+ Example string
26
Flags map[string]Flag
27
Commands map[string]*Command
28
}
@@ -176,6 +177,24 @@ func (m ManPage) buildCommand(w Builder, c Command) {
176
177
w.IndentEnd()
178
179
180
+
181
+ if c.Example != "" {
182
+ if c.Name == m.Root.Name {
183
+ w.Section("Examples")
184
+ w.TaggedParagraph(-1)
185
+ } else {
186
187
+ w.TextBold("EXAMPLES")
188
+ w.Indent(4)
189
+ }
190
+ w.Text(c.Example)
191
192
193
+ w.EndSection()
194
195
+ w.IndentEnd()
196
197
198
199
200
// Build generates the man page.
0 commit comments