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

Allow int arg to be 0 #49

Merged
merged 3 commits into from
Jan 8, 2017
Merged

Allow int arg to be 0 #49

merged 3 commits into from
Jan 8, 2017

Conversation

pablopunk
Copy link
Contributor

This should solve vercel/serve#57

Basically when passing a value of 0 to a integer arg, the value would be set to default

Before

node example.js --cache 0 # sets cache to default value

After

node example.js --cache 0 # sets cache to 0

let propVal = value
if (typeof option.defaultValue !== 'undefined' && typeof propVal !== typeof option.defaultValue) {
propVal = option.defaultValue
}
Copy link
Owner

Choose a reason for hiding this comment

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

You can add an empty line here?

value = fromArgs
}
}

// Process the option's value
for (let name of option.usage) {
let propVal = value || option.defaultValue
let propVal = value
Copy link
Owner

Choose a reason for hiding this comment

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

You can add an empty line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leo done 👍

@leo leo merged commit 94e2f21 into leo:master Jan 8, 2017
@leo
Copy link
Owner

leo commented Jan 8, 2017

Thanks a lot!

leo pushed a commit that referenced this pull request May 1, 2022
* Allow int value to be 0

* Add emtpy lines
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