diff --git a/nomnom.js b/nomnom.js index 9a8468c..ec3f998 100644 --- a/nomnom.js +++ b/nomnom.js @@ -487,7 +487,7 @@ ArgParser.prototype.setOption = function(options, arg, value) { Arg = function(str) { var abbrRegex = /^\-(\w+?)$/, fullRegex = /^\-\-(no\-)?(.+?)(?:=(.+))?$/, - valRegex = /^[^\-].*/; + valRegex = /\s|^[^\-].*/; var charMatch = abbrRegex.exec(str), chars = charMatch && charMatch[1].split(""); diff --git a/test/values.js b/test/values.js index 797807e..0e3b1fd 100644 --- a/test/values.js +++ b/test/values.js @@ -72,4 +72,9 @@ exports.testTypes = function(test) { test.done(); } +exports.testValues = function(test) { + var options = parser.parseArgs(["--num1", "-4 4"]); + test.strictEqual(options.num1, "-4 4"); + test.done(); +}