We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flagz
flag
spf13/pflag
Currently we're tied to spf13/pflag due to two things.
First, we're using Annotations. It would be trivial to remove them and rely on whether the Value implements Type() and check the prefix for dyn_.
Value
Type()
dyn_
Secondly, and less trivially, the interfaces for pflag.Value and flag.Value don't match, as well as the types of Flag.
pflag.Value
flag.Value
Flag
https://godoc.org/flag#Flag https://godoc.org/flag#Value
vs
https://godoc.org/github.com/spf13/pflag#Flag https://godoc.org/github.com/spf13/pflag#Value
For Dyn* flags, we could achieve complete independence from spf13/pflag vs flag if FlagSet.Var accepted a Value that could be abstracted as common.
Dyn*
FlagSet.Var
However, for monitoring and debug endpoints, we need calls to VisitAll. These return an explicit Flag type that differs between the two.
VisitAll
The second problem can be worked around by just recompiling flagz with s/flag "github.com/spf13/flag"/"flag" ;)
s/flag "github.com/spf13/flag"/"flag"
The text was updated successfully, but these errors were encountered:
This is done in https://github.com/fortio/dflag
Sorry, something went wrong.
Thanks Laurent. Sorry for not being able to maintain this any more actively.
No worries at all, and I am happy I was able to take your great package and further evolve it. So thank you for making this.
No branches or pull requests
Currently we're tied to
spf13/pflag
due to two things.First, we're using Annotations. It would be trivial to remove them and rely on whether the
Value
implementsType()
and check the prefix fordyn_
.Secondly, and less trivially, the interfaces for
pflag.Value
andflag.Value
don't match, as well as the types ofFlag
.https://godoc.org/flag#Flag
https://godoc.org/flag#Value
vs
https://godoc.org/github.com/spf13/pflag#Flag
https://godoc.org/github.com/spf13/pflag#Value
For
Dyn*
flags, we could achieve complete independence fromspf13/pflag
vsflag
ifFlagSet.Var
accepted aValue
that could be abstracted as common.However, for monitoring and debug endpoints, we need calls to
VisitAll
. These return an explicitFlag
type that differs between the two.The second problem can be worked around by just recompiling
flagz
withs/flag "github.com/spf13/flag"/"flag"
;)The text was updated successfully, but these errors were encountered: