More group formatting tweaks.
This commit is contained in:
@@ -151,8 +151,7 @@ func printNodeDetail(w *helpWriter, node *Node, hide bool) {
|
|||||||
w.Wrap(group.Metadata.Title)
|
w.Wrap(group.Metadata.Title)
|
||||||
}
|
}
|
||||||
if group.Metadata.Description != "" {
|
if group.Metadata.Description != "" {
|
||||||
w.Print("")
|
w.Indent().Wrap(group.Metadata.Description)
|
||||||
w.Wrap(group.Metadata.Description)
|
|
||||||
w.Print("")
|
w.Print("")
|
||||||
}
|
}
|
||||||
writeFlags(w.Indent(), group.Flags)
|
writeFlags(w.Indent(), group.Flags)
|
||||||
@@ -173,8 +172,7 @@ func printNodeDetail(w *helpWriter, node *Node, hide bool) {
|
|||||||
w.Wrap(group.Metadata.Title)
|
w.Wrap(group.Metadata.Title)
|
||||||
}
|
}
|
||||||
if group.Metadata.Description != "" {
|
if group.Metadata.Description != "" {
|
||||||
w.Print("")
|
w.Indent().Wrap(group.Metadata.Description)
|
||||||
w.Wrap(group.Metadata.Description)
|
|
||||||
w.Print("")
|
w.Print("")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,6 +346,7 @@ func (h *helpWriter) Print(text string) {
|
|||||||
*h.lines = append(*h.lines, strings.TrimRight(h.indent+text, " "))
|
*h.lines = append(*h.lines, strings.TrimRight(h.indent+text, " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Indent returns a new helpWriter indented by two characters.
|
||||||
func (h *helpWriter) Indent() *helpWriter {
|
func (h *helpWriter) Indent() *helpWriter {
|
||||||
return &helpWriter{indent: h.indent + " ", lines: h.lines, width: h.width - 2, HelpOptions: h.HelpOptions, helpFormatter: h.helpFormatter}
|
return &helpWriter{indent: h.indent + " ", lines: h.lines, width: h.width - 2, HelpOptions: h.HelpOptions, helpFormatter: h.helpFormatter}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-6
@@ -323,8 +323,7 @@ Flags:
|
|||||||
--free-bool A non grouped bool flag.
|
--free-bool A non grouped bool flag.
|
||||||
|
|
||||||
Group title taken from the kong.ExplicitGroups option
|
Group title taken from the kong.ExplicitGroups option
|
||||||
|
A group header
|
||||||
A group header
|
|
||||||
|
|
||||||
--grouped-a-string=STRING A string flag grouped in A.
|
--grouped-a-string=STRING A string flag grouped in A.
|
||||||
--grouped-a-bool A bool flag grouped in A.
|
--grouped-a-bool A bool flag grouped in A.
|
||||||
@@ -337,8 +336,7 @@ Commands:
|
|||||||
A non grouped subcommand.
|
A non grouped subcommand.
|
||||||
|
|
||||||
Group title taken from the kong.ExplicitGroups option
|
Group title taken from the kong.ExplicitGroups option
|
||||||
|
A group header
|
||||||
A group header
|
|
||||||
|
|
||||||
one thing <arg>
|
one thing <arg>
|
||||||
subcommand thing
|
subcommand thing
|
||||||
@@ -383,8 +381,7 @@ Flags:
|
|||||||
--a-free-string=STRING A non grouped string flag.
|
--a-free-string=STRING A non grouped string flag.
|
||||||
|
|
||||||
Group title taken from the kong.ExplicitGroups option
|
Group title taken from the kong.ExplicitGroups option
|
||||||
|
A group header
|
||||||
A group header
|
|
||||||
|
|
||||||
--grouped-a-string=STRING A string flag grouped in A.
|
--grouped-a-string=STRING A string flag grouped in A.
|
||||||
--grouped-a-bool A bool flag grouped in A.
|
--grouped-a-bool A bool flag grouped in A.
|
||||||
|
|||||||
Reference in New Issue
Block a user