Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseArgsWithValueModifier ¶
func ParseArgsWithValueModifier(command string, data interface{}, args []string, argumentModFunc ArgumentModFunc) ([]string, error)
ParseArgsWithValueModifier parses flags and args from a command string; it accepts an optional argumentModFunc which is called before each flag value is parsed, and allows one to change the value. if the flag value
Types ¶
type ArgumentModFunc ¶
ArgumentModFunc accepts a flagName which corresponds to the long flag name, and a pointer to a flag value. The pointer is nil if no flag was given. the function returns a new pointer set to nil if one wants to pretend as if no value was given, or a pointer to a new value which will be parsed. Note: this was created to allow passing --no-cache=$SOME_VALUE; where we must expand $SOME_VALUE into a true/false value before it is parsed. If this feature is used extensively, then it might be time to completely fork go-flags with a version where we can include control over expansion struct tags.