Documentation ¶
Overview ¶
Package stringlistflag provides a flag.Value implementation which resolves multiple args into a []string.
Example ¶
Example demonstrates how to use stringlistflag.
list := Flag{} fs := flag.NewFlagSet("test", flag.ContinueOnError) fs.Var(&list, "color", "favorite color, may be repeated.") fs.SetOutput(os.Stdout) fs.PrintDefaults() // Flag parsing. fs.Parse([]string{"-color", "Violet", "-color", "Red", "-color", "Violet"}) fmt.Printf("Value is: %s\n", list)
Output: -color value favorite color, may be repeated. Value is: Violet, Red, Violet
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.