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

Add hide default value in help/usage #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add hide default value in help/usage #251

wants to merge 2 commits into from

Conversation

nateph
Copy link

@nateph nateph commented Mar 3, 2020

Currently if you add a default value through NoOptDefVal or DefValue, it gets printed in the help/usage message.

fs.StringVarP(&cs.Password, "password", "p", "default", "the password for a remote user supplied by -u or --user.")
fs.Lookup("password").NoOptDefVal = "default"

results in

-p, --password string[="default"]   the password for a remote user supplied by -u or --user. (default "default")

This field in the Flag type would omit the [="default"] and (default "default") additions.

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2020

CLA assistant check
All committers have signed the CLA.

@AdamSLevy
Copy link

#205

@erezpaz125
Copy link

Hi, can this PR be merged? This issue is relevant for a project at my workplace and it would help alot. Thank you!

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.

4 participants