-
-
Notifications
You must be signed in to change notification settings - Fork 544
fix: parse boolean values from command line #1215
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
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Michal
The idea is that you can negate using --no-
e.g. --no-git.commit
(https://www.npmjs.com/package/yargs-parser#boolean-negation)
It's cool if we'd be able to use =false
(and =0
?) to negate as well, but it is not documented: https://www.npmjs.com/package/yargs-parser - any chance you could squeeze in a test somewhere?
Actually, both are supported by yargs, where --no flags being an extra feature (can be disabled). When using in scripts, its often more readable to do About unit test, thats good idea. |
Good point, haven't used it that way yet.
Thanks! |
Don't use "false" string as true value
I've refactored bin to args.js, so it is testable. Testing whole bin js is problematic (but can be done). |
This is great! Thanks. |
🚀 This pull request is included in v19.0.0-next.4. See Release 19.0.0-next.4 for release notes. |
Don't use "false" string as true value.
For example
release-it --git.commit=false
was parsed astrue
, because string"false"
is non-empty.