-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: render default arg/opt if equal to 0 #264
Conversation
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.
I'd rather see us explicitly call out equality to 0
to avoid other unintended values.
I deliberately used my approach, because the I took a look at the oclif/parser and I believe this 2 is probably why the type of a default is not a Footnotes
|
@akwodkiewicz good point. I updated my original suggestions a little bit to account for that. |
@RodEsp, thanks for the changes. Should I add an inline comment explaining why we're calling |
@akwodkiewicz a comment would be great 🙂 |
When the default value for an arg/flag was set to `0` then the `--help` was not displaying it, as if the default was not set. There is probably a typing bug in oclif/config or oclif/parser (depending on what's the desired outcome). The default values typing is `string`, however the actual values can be set to numbers.
@RodEsp , I have made the changes |
Thanks for the contribution @akwodkiewicz! |
## [3.2.3](v3.2.2...v3.2.3) (2021-08-11) ### Bug Fixes * render default arg/opt if equal to 0 ([#264](#264)) ([ca0af19](ca0af19))
This PR fixes rendering of default values for arguments and flags.
Before the fix, if an arg/flag default was set to 0, it was not rendered.
I couldn't reopen or edit my existing PR, so this is an updated version of #248, but the base branch is set to
main
this time.