pflag
pflag copied to clipboard
support VarPF variantes for options to return created flags
The actuals variants of the flag creation do not report back the generated Flag object. But this would be reqired to do further tweaking according to the public fields of a Flag, like adding of annotations.
Therefore it would be useful to have an additional variant of the option creation methods on a FlagSet, which returns the generated Flag object.
The underlying method VarPF already exists and can directly be used to support appropriate VarPF variants for the type specific methods.
For example func (f *FlagSet) StringVarPF(p *string, name, shorthand string, value string, usage string) *Flag