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

Boolean arguments do not always need explicit values. #1

Closed
cznic opened this issue Nov 3, 2015 · 1 comment
Closed

Boolean arguments do not always need explicit values. #1

cznic opened this issue Nov 3, 2015 · 1 comment

Comments

@cznic
Copy link

cznic commented Nov 3, 2015

From README.md:

Boolean arguments must have explicit values, so ./prog -debug=1 sets debug to true but ./myprog -debug does not.

Not true. If you define

debug := flag.Bool("debug", false, "whatever")

Then passing -debug is enough to have the variable debug hold a true value.

@alexflint
Copy link
Owner

Thanks for the catch - fixed.

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

No branches or pull requests

2 participants