Skip to content

Commit 9114559

Browse files
authored
Merge pull request #1956 from BlackHole1/improve-flags-docs
docs(flag): add `UseShortOptionHandling` description
2 parents f21e902 + 584e28a commit 9114559

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/v2/examples/flags.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ See full list of flags at https://pkg.go.dev/github.com/urfave/cli/v2
104104

105105
For bool flags you can specify the flag multiple times to get a count(e.g -v -v -v or -vvv)
106106

107+
> If you want to support the `-vvv` flag, you need to set `App.UseShortOptionHandling`.
108+
107109
<!-- {
108-
"args": ["&#45;&#45;foo", "&#45;&#45;foo"],
109-
"output": "count 2"
110+
"args": ["&#45;&#45;f", "&#45;&#45;f", "&#45;fff", "&#45;f"],
111+
"output": "count 6"
110112
} -->
111113
```go
112114
package main
@@ -123,10 +125,12 @@ func main() {
123125
var count int
124126

125127
app := &cli.App{
128+
UseShortOptionHandling: true,
126129
Flags: []cli.Flag{
127130
&cli.BoolFlag{
128131
Name: "foo",
129132
Usage: "foo greeting",
133+
Aliases: []string{"f"},
130134
Count: &count,
131135
},
132136
},

0 commit comments

Comments
 (0)