An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

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.

Ecosystem
proxy.golang.org
Latest Release
v0.10.1
over 5 years ago
Versions
3
Past Dependents
Include Past Dependents

Check this option to include packages that no longer depend on this package in their latest version but previously did.

Filter
Filter by Kind
Links
Registry proxy.golang.org
Source Repository
Homepage Homepage
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/%21the%21dive%21o/enumflag
spec
License Apache-2.0
Namespace github.com/TheDiveO
First Release almost 6 years ago
Last Synced 25 days ago
Repository
Stars 33 on GitHub
Forks 4 on GitHub
Rankings on proxy.golang.org
Overall Top 7.0%
Forks Top 6.1%