Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagSet ¶
FlagSet is a flag.Flag implementation that parses into a nested flag.FlagSet.
The FlagSet's flag value is parsed broken into a series of sub-options, which are then loaded into the nested flag set (FlagSet.F).
Example ¶
ExampleFlagSet demonstrates nestedflagset.FlagSet usage.
nfs := &FlagSet{} s := nfs.F.String("str", "", "Nested string option.") i := nfs.F.Int("int", 0, "Nested integer option.") if err := nfs.Parse(`str="Hello, world!",int=10`); err != nil { panic(err) } fmt.Printf("Parsed str=[%s], int=%d.\n", *s, *i)
Output: Parsed str=[Hello, world!], int=10.
Click to show internal directories.
Click to hide internal directories.