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

Omit default from usage if DefValue is empty #205

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

Conversation

AdamSLevy
Copy link

Fix #204

This change allows a user to set Flag.DefValue to an empty string to suppress the "(default %v)" printed in the usage line for custom Value types that have non-standard zero values.

For example

flags:=flag.NewFlagSet("",flag.ContinueOnError)
flags.VarPF(&myValue, "value", "", "usage").DefValue = ""

Will suppress the default message in the usage line.

@CLAassistant
Copy link

CLAassistant commented Apr 24, 2019

CLA assistant check
All committers have signed the CLA.

@erezpaz125
Copy link

Hi,
I wanted to know if this pull request could be approved (as I see all checks have passed)
It deals with an issue that came up at my workplace and it would be very helpful.
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.

Hide Default Value in usage for Value's with irregular zero values
3 participants