Skip to content
New issue

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

support VarPF variantes for options to return created flags #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mandelsoft
Copy link

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

@CLAassistant
Copy link

CLAassistant commented Nov 1, 2022

CLA assistant check
All committers have signed the CLA.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants