Documentation ¶
Overview ¶
Package flagutil contains flags that parse string lists and string maps.
Index ¶
- func DualFormatBoolVar(p *bool, name string, value bool, usage string)
- func DualFormatInt64Var(p *int64, name string, value int64, usage string)
- func DualFormatIntVar(p *int, name string, value int, usage string)
- func DualFormatStringListVar(p *[]string, name string, value []string, usage string)
- func DualFormatStringVar(p *string, name string, value string, usage string)
- func StringListVar(p *[]string, name string, defaultValue []string, usage string)
- type StringListValue
- type StringMapValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DualFormatBoolVar ¶ added in v0.10.0
DualFormatBoolVar creates a flag which supports both dashes and underscores
func DualFormatInt64Var ¶ added in v0.10.0
DualFormatInt64Var creates a flag which supports both dashes and underscores
func DualFormatIntVar ¶ added in v0.10.0
DualFormatIntVar creates a flag which supports both dashes and underscores
func DualFormatStringListVar ¶ added in v0.10.0
DualFormatStringListVar creates a flag which supports both dashes and underscores
func DualFormatStringVar ¶ added in v0.10.0
DualFormatStringVar creates a flag which supports both dashes and underscores
Types ¶
type StringListValue ¶
type StringListValue []string
StringListValue is a []string flag that accepts a comma separated list of elements. To include an element containing a comma, quote it with a backslash '\'.
func (StringListValue) Get ¶
func (value StringListValue) Get() interface{}
Get returns the []string value of this flag.
func (*StringListValue) Set ¶
func (value *StringListValue) Set(v string) error
Set sets the value of this flag from parsing the given string.
func (StringListValue) String ¶
func (value StringListValue) String() string
String returns the string representation of this flag.
type StringMapValue ¶
StringMapValue is a map[string]string flag. It accepts a comma-separated list of key value pairs, of the form key:value. The keys cannot contain colons.
func (StringMapValue) Get ¶
func (value StringMapValue) Get() interface{}
Get returns the map[string]string value of this flag.
func (*StringMapValue) Set ¶
func (value *StringMapValue) Set(v string) error
Set sets the value of this flag from parsing the given string.
func (StringMapValue) String ¶
func (value StringMapValue) String() string
String returns the string representation of this flag.