Documentation
¶
Overview ¶
Package flagx provides additional flag functions.
Index ¶
- func FloatBetween(name string, value float64, usage string, minVal, maxVal float64, ...) *float64
- func FloatBetweenFlagSet(fs *flag.FlagSet, name string, value float64, usage string, ...) *float64
- func IntBetween(name string, value int, usage string, minVal, maxVal int) *int
- func IntBetweenFlagSet(fs *flag.FlagSet, name string, value int, usage string, minVal, maxVal int) *int
- func Regexp(name string, value *regexp.Regexp, usage string) **regexp.Regexp
- func RegexpFlagSet(fs *flag.FlagSet, name string, value *regexp.Regexp, usage string) **regexp.Regexp
- func StringFrom(name string, value string, usage string, from ...string) *string
- func StringFromFlagSet(fs *flag.FlagSet, name string, value string, usage string, from ...string) *string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FloatBetween ¶
func FloatBetween(name string, value float64, usage string, minVal, maxVal float64, incMin, incMax bool) *float64
FloatBetween defines a float flag with specified name, default value, usage string and bounds. incMin and incMax define whether min and max are included in the allowed values. The return value is the address of a float variable that stores the value of the flag.
func FloatBetweenFlagSet ¶
func FloatBetweenFlagSet(fs *flag.FlagSet, name string, value float64, usage string, minVal, maxVal float64, incMin, incMax bool) *float64
FloatBetweenFlagSet defines a float flag with specified name, default value, usage string and bounds. incMin and incMax define whether min and max are included in the allowed values. The return value is the address of a float variable that stores the value of the flag.
func IntBetween ¶
IntBetween defines an int flag with specified name, default value, usage string and bounds. The return value is the address of an int variable that stores the value of the flag.
func IntBetweenFlagSet ¶
func IntBetweenFlagSet(fs *flag.FlagSet, name string, value int, usage string, minVal, maxVal int) *int
IntBetweenFlagSet defines an int flag with specified name, default value, usage string and bounds. The return value is the address of an int variable that stores the value of the flag.
func Regexp ¶
Regexp defines a regular expression flag with specified name, default value, and usage string. The return value is the address of a regular expression variable that stores the value of the flag.
func RegexpFlagSet ¶
func RegexpFlagSet(fs *flag.FlagSet, name string, value *regexp.Regexp, usage string) **regexp.Regexp
RegexpFlagSet defines a regular expression flag with specified name, default value, and usage string. The return value is the address of a regular expression variable that stores the value of the flag.
func StringFrom ¶
StringFrom defines a string flag with specified name, default value, usage string and allowed values. The return value is the address of a string variable that stores the value of the flag.
func StringFromFlagSet ¶
func StringFromFlagSet(fs *flag.FlagSet, name string, value string, usage string, from ...string) *string
StringFromFlagSet defines a string flag with specified name, default value, usage string and allowed values. The return value is the address of a string variable that stores the value of the flag.
Types ¶
This section is empty.