MCPcopy
hub / github.com/spf13/pflag / ExampleShorthandLookup

Function ExampleShorthandLookup

example_test.go:13–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func ExampleShorthandLookup() {
14 name := "verbose"
15 short := name[:1]
16
17 pflag.BoolP(name, short, false, "verbose output")
18
19 // len(short) must be == 1
20 flag := pflag.ShorthandLookup(short)
21
22 fmt.Println(flag.Name)
23}
24
25func ExampleFlagSet_ShorthandLookup() {
26 name := "verbose"

Callers

nothing calls this directly

Calls 2

BoolPFunction · 0.92
ShorthandLookupFunction · 0.92

Tested by

no test coverage detected