thediveo / enumflag Goto Github PK
View Code? Open in Web Editor NEWTyped enumeration flags (single and slice) for spf13/pflag, Go's flag drop-in package.
License: Apache License 2.0
Typed enumeration flags (single and slice) for spf13/pflag, Go's flag drop-in package.
License: Apache License 2.0
I am trying to map log levels from an external library to a enum and what should be the sane default
level of INFO
is 4
, DEBUG
is 0
and I can not find any other way to tell it which one to pick for the default
This looks like a great library. One thing I noticed missing was support for flag auto-completion with cobra.
This SO answer shows a good example of how that can be implemented: https://stackoverflow.com/a/70541824/337735
(Incidentally I found your library on this SO answer too. And here you are! https://stackoverflow.com/questions/50824554/permitted-flag-values-for-cobra#comment133213356_73297333 :))
Hi,
I wish to use this package for enum value verification for enum typed flags, however I do not wish for these flags to have a default value so that if the user won't enter a required flag it will throw him an error.
Currently I couldn't figure out a way to do this since it seems that it is necessary to use Var/VarP which cause it to always have a default value.
Is there some way to make this work that I missed out on?
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.