aboutsummaryrefslogtreecommitdiffhomepage
path: root/command/flag.go
diff options
context:
space:
mode:
Diffstat (limited to 'command/flag.go')
-rw-r--r--command/flag.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/command/flag.go b/command/flag.go
index cb85a648..d7eb6cb2 100644
--- a/command/flag.go
+++ b/command/flag.go
@@ -16,7 +16,13 @@ func (e FlagError) Is(target error) bool {
}
func (n *node) Flag(p any, name string, value FlagDefiner, usage string) Node {
- value.Define(&n.suffix, n.set, p, name, usage)
+ var buf strings.Builder
+ value.Define(&buf, n.set, p, name, usage)
+ s := buf.String()
+ if len(s) > 0 && s[0] == ' ' {
+ s = s[1:]
+ }
+ n.suffix = append(n.suffix, s)
return n
}