minimist
Advanced tools
Comparing version 0.0.10 to 0.1.0
14
index.js
@@ -146,5 +146,13 @@ module.exports = function (args, opts) { | ||
notFlags.forEach(function(key) { | ||
argv._.push(key); | ||
}); | ||
if (opts['--']) { | ||
argv['--'] = new Array(); | ||
notFlags.forEach(function(key) { | ||
argv['--'].push(key); | ||
}); | ||
} | ||
else { | ||
notFlags.forEach(function(key) { | ||
argv._.push(key); | ||
}); | ||
} | ||
@@ -151,0 +159,0 @@ return argv; |
{ | ||
"name": "minimist", | ||
"version": "0.0.10", | ||
"version": "0.1.0", | ||
"description": "parse argument options", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,1 +25,8 @@ var parse = require('../'); | ||
}); | ||
test('move arguments after the -- into their own `--` array', function(t) { | ||
t.plan(1); | ||
t.deepEqual( | ||
parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), | ||
{ name: 'John', _: [ 'before' ], '--': [ 'after' ] }); | ||
}); |
Sorry, the diff of this file is not supported yet
23089
651
85