-
Notifications
You must be signed in to change notification settings - Fork 24
Description
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_
.
Secondly, and less trivially, the interfaces for pflag.Value
and flag.Value
don't match, as well as the types of 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.
However, for monitoring and debug endpoints, we need calls to VisitAll
. These return an explicit Flag
type that differs between the two.
The second problem can be worked around by just recompiling flagz
with s/flag "github.com/spf13/flag"/"flag"
;)