forked from rosa/hakurei
command: hard wrap help message flags
This greatly improves readability when lots of flags are registered. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+2
-2
@@ -23,8 +23,8 @@ func newNode(output io.Writer, logf LogFunc, name, usage string) *node {
|
||||
n.set.SetOutput(output)
|
||||
n.set.Usage = func() {
|
||||
_ = n.writeHelp()
|
||||
if n.suffix.Len() > 0 {
|
||||
_, _ = fmt.Fprintln(output, "Flags:")
|
||||
if len(n.suffix) > 0 {
|
||||
_, _ = fmt.Fprintln(output, "flags:")
|
||||
n.set.PrintDefaults()
|
||||
_, _ = fmt.Fprintln(output)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user