Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Addresses bug with array of number argument #4

Closed
wants to merge 1 commit into from

2 participants

tifroz Oleg Slobodskoi
tifroz

Fixes bug with array of numbers argument, e.g. node server.js --port 80 8080

When executing node server.js --port 80 8080, the current version will produce an error TypeError: Object 80 has no method 'push'

Oleg Slobodskoi kof closed this pull request from a commit
Oleg Slobodskoi add test. Closes #4. 10da793
Oleg Slobodskoi kof closed this in 10da793
Oleg Slobodskoi
Owner

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 13, 2011
  1. tifroz
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/argsparser.js
2  lib/argsparser.js
View
@@ -29,7 +29,7 @@ exports.parse = function(args) {
if (curValType === 'boolean') {
opts[curSwitch] = arg;
- } else if (curValType === 'string') {
+ } else if (curValType === 'string' || curValType === 'number') {
opts[curSwitch] = [opts[curSwitch], arg];
} else {
opts[curSwitch].push(arg);
Something went wrong with that request. Please try again.