Top 0.7% dependent packages on proxy.golang.org
Top 0.9% dependent repos on proxy.golang.org
Top 0.8% docker downloads on proxy.golang.org
proxy.golang.org : github.com/thediveo/enumflag
Package enumflag supplements the Golang CLI flag handling packages spf13/cobra and spf13/pflag with enumeration flags. For instance, users can specify enum flags as "--mode=foo" or "--mode=bar", where "foo" and "bar" are valid enumeration values. Other values which are not part of the set of allowed enumeration values cannot be set and raise CLI flag errors. Application programmers then simply deal with enumeration values in form of uints (or ints), liberated from parsing strings and validating enumeration flags. User-defined enum flag types should be derived from "enumflag.Flag"; however this is not strictly necessary as long as they can be converted into the "enumflag.Flag" type. Actually, "enumflag.Flag" is just a fancy name for an "uint". In order to use such user-defined enum flags, simply wrap them using enumflag.New. User-defined enum flag types should be derived from "enumflag.Flag"; however this is not strictly necessary as long as they can be converted into the "enumflag.Flag" type. Actually, "enumflag.Flag" is just a fancy name for an "uint". In order to use such user-defined enum flags as flag slices, simply wrap them using enumflag.NewSlice.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/thediveo/enumflag
Keywords:
cli
, cli-flags
, enum
, go
, golang
License: Apache-2.0
Latest release: over 4 years ago
First release: about 5 years ago
Namespace: github.com/thediveo
Dependent packages: 42
Dependent repositories: 37
Stars: 13 on GitHub
Forks: 2 on GitHub
Docker dependents: 6
Docker downloads: 50,088
See more repository details: repos.ecosyste.ms
Last synced: about 1 month ago