diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-08-07 20:32:24 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-08-07 20:32:24 +0900 |
| commit | f1dd3a085b029ecf29b75373c0f7c982dbe72b88 (patch) | |
| tree | c373765b74aa7257c87761f02f5ab24e2d2de6ee /command/builder.go | |
| parent | b37c1d899349fef9e7af38940ae0c2d507c433a9 (diff) | |
command: hard wrap help message flags
This greatly improves readability when lots of flags are registered.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'command/builder.go')
| -rw-r--r-- | command/builder.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/command/builder.go b/command/builder.go index d3b0c3f5..174010ea 100644 --- a/command/builder.go +++ b/command/builder.go @@ -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) } |
