optimist
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -331,3 +331,6 @@ var path = require('path'); | ||
else if (arg.match(/^--.+=/)) { | ||
var m = arg.match(/^--([^=]+)=(.*)/); | ||
// Using [\s\S] instead of . because js doesn't support the | ||
// 'dotall' regex modifier. See: | ||
// http://stackoverflow.com/a/1068308/13216 | ||
var m = arg.match(/^--([^=]+)=([\s\S]*)$/); | ||
setArg(m[1], m[2]); | ||
@@ -334,0 +337,0 @@ } |
{ | ||
"name" : "optimist", | ||
"version" : "0.3.5", | ||
"version" : "0.3.6", | ||
"description" : "Light-weight option parsing with an argv hash. No optstrings attached.", | ||
"main" : "./index.js", | ||
"directories" : { | ||
"lib" : ".", | ||
"test" : "test", | ||
"example" : "example" | ||
}, | ||
"dependencies" : { | ||
@@ -16,3 +11,3 @@ "wordwrap" : "~0.0.2" | ||
"hashish": "~0.0.4", | ||
"tap" : "~0.2.4" | ||
"tap" : "~0.4.0" | ||
}, | ||
@@ -19,0 +14,0 @@ "scripts" : { |
@@ -247,2 +247,15 @@ var optimist = require('../index'); | ||
test('newlines in params' , function (t) { | ||
var args = optimist.parse([ '-s', "X\nX" ]) | ||
t.same(args, { _ : [], s : "X\nX", $0 : $0 }); | ||
// reproduce in bash: | ||
// VALUE="new | ||
// line" | ||
// node program.js --s="$VALUE" | ||
args = optimist.parse([ "--s=X\nX" ]) | ||
t.same(args, { _ : [], s : "X\nX", $0 : $0 }); | ||
t.end(); | ||
}); | ||
test('strings' , function (t) { | ||
@@ -249,0 +262,0 @@ var s = optimist([ '-s', '0001234' ]).string('s').argv.s; |
Sorry, the diff of this file is not supported yet
49033
1267