Documentation
¶
Overview ¶
Package stringlist implements a custom "stringlist" flag It accepts comma separated values and repeated flag occurrence. Leading and trailing whitespace will be trimmed.
Usage:
var (
myFlag stringlist.Value
)
func init() {
flag.Var(&myFlag, "myflag", "a list of strings")
}
Or:
var (
myFlag = stringlist.Flag("myflag", "a list of strings")
)
func foo() {
for _, i = range *myFlag {
// note: you need to dereference the slice
}
}
If you invoke it with:
--myflag a,b --myflag c --myflag "c, d"
myFlag will contain: []string{"a", "b", "c", "d"}
Index ¶
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.