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

Fix for requiresArg with number type #1015

Merged
merged 3 commits into from Dec 18, 2017
Merged

Fix for requiresArg with number type #1015

merged 3 commits into from Dec 18, 2017

Conversation

edmBernard
Copy link
Contributor

@edmBernard edmBernard commented Nov 28, 2017

to fix this issue: #1007

Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great work 💯 I'm glad we now have some tests for requiresArg; it might take me a little bit of time to land, because I want to dig into the logic around defaultValues; the historical implementation feels a bit fragile.

@@ -57,7 +57,7 @@ module.exports = function validation (yargs, usage, y18n) {
// make sure that any args that require an
// value (--foo=bar), have a value.
self.missingArgumentValue = function missingArgumentValue (argv) {
const defaultValues = [true, false, '']
const defaultValues = [true, false, '', undefined]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this logic a little weird (it's not your fault, this oddity was already in the codebase). I'm going to do a little bit of investigation when I have some cycles and see if we can figure out a better way to determine if a value has been provided.

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.

None yet

2 participants