spf13 / pflag

Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
BSD 3-Clause "New" or "Revised" License
2.43k stars 348 forks source link

Expose Value implementations to use with FlagSet.AddFlag #334

Open mattysweeps opened 3 years ago

mattysweeps commented 3 years ago

It would be useful when dynamically adding Flags to a FlagSet to be allowed to reuse the underlying primitive implementations of a Value.

The boolean implementation for reference: https://github.com/spf13/pflag/blob/master/bool.go#L13

This makes it difficult to use the Flag struct directly because I have to create something identical to boolValue.