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

Custom flag's usage string shouldn't change its "defaults" section after parsing #243

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

Conversation

avoskresensky
Copy link

Right now the "defaults" section of the usage line of a custom flag is generated based on the value of "f.Value.String()" which can change after parsing. So the "usage" info returned by the following two types pf invocation can be different:

(--customFlag has no default)
./program --help
./program --customFlag=10 --help

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

hoshsadiq pushed a commit to zulucmd/zflag that referenced this pull request Feb 4, 2022
Right now the "defaults" section of the usage line of a custom flag is
generated based on the value of "f.Value.String()" which can change
after parsing. So the "usage" info returned by the following two
types of invocation can be different:

(--customFlag has no default)
./program --help
./program --customFlag=10 --help

Merges spf13#243
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