aboutsummaryrefslogtreecommitdiff
path: root/bool.go
AgeCommit message (Collapse)Author
2016-09-10Use strconv instead of fmt in values' String funcsbogem
The existing implementation of flag values with fmt package uses more memory and works slower than the implementation with strconv package.
2015-08-15Fix up minor things found by goreportcard.comEric Paris
2015-06-22Set default values if no arg givenEric Paris
2015-06-01Add new FlagSet.Get{Int,String,...} accessor functionsEric Paris
If I declared a bool flag named "hello" I can now call b, err := f.GetBool("hello") And b will hold the value of the flag We can see this is already done in https://github.com/codegangsta/cli/blob/bcec9b08c7e5564f7512ad7e7b03778fe1923116/context.go If people use the codegangsta/cli Other projects have done it themselves using pflags (what inspired this patch) https://github.com/GoogleCloudPlatform/kubernetes/blob/cd817aebd848facda29e0befbbd6e31bf22402e6/pkg/kubectl/cmd/util/helpers.go#L176 Lets just do it ourselves...
2015-01-16Add support for custom boolean flags through IsBoolFlag()Filipe Brandenburger
This is consistent with Go's native flag parsing module and can be used to implement custom boolean/tri-state flags. Signed-off-by: Filipe Brandenburger <[email protected]>
2014-07-11Adding Type() method to the values.spf13
2014-04-02Compatibility: commandLine -> CommandLineAlec Thomas
2014-03-17More data types. Each in a separate file.Riobard