diff --git a/docs/v2/examples/flags.md b/docs/v2/examples/flags.md index eb87e6c6d4..2f16c4c3e8 100644 --- a/docs/v2/examples/flags.md +++ b/docs/v2/examples/flags.md @@ -104,9 +104,11 @@ See full list of flags at https://pkg.go.dev/github.com/urfave/cli/v2 For bool flags you can specify the flag multiple times to get a count(e.g -v -v -v or -vvv) +> If you want to support the `-vvv` flag, you need to set `App.UseShortOptionHandling`. + ```go package main @@ -123,10 +125,12 @@ func main() { var count int app := &cli.App{ + UseShortOptionHandling: true, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "foo", Usage: "foo greeting", + Aliases: []string{"f"}, Count: &count, }, }, diff --git a/docs/v3/examples/flags.md b/docs/v3/examples/flags.md index 1344c55182..04d1aefb44 100644 --- a/docs/v3/examples/flags.md +++ b/docs/v3/examples/flags.md @@ -106,9 +106,11 @@ See full list of flags at https://pkg.go.dev/github.com/urfave/cli/v3 For bool flags you can specify the flag multiple times to get a count(e.g -v -v -v or -vvv) +> If you want to support the `-vvv` flag, you need to set `Command.UseShortOptionHandling`. + ```go package main @@ -126,10 +128,12 @@ func main() { var count int cmd := &cli.Command{ + UseShortOptionHandling: true, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "foo", Usage: "foo greeting", + Aliases: []string{"f"}, Config: cli.BoolConfig{ Count: &count, },