posix-argv-parser
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -20,11 +20,19 @@ function Shorthand(option, expansion) { | ||
return args.reduce(function (expanded, arg) { | ||
var expansion = this.recognizes(arg) ? | ||
this.expansion.concat(arg.replace(this.option, "")) : arg; | ||
if (expansion[expansion.length - 1] === "-") { | ||
expansion.pop(); | ||
if (this.recognizes(arg)) { | ||
var expansion = this.expansion.concat( | ||
arg.replace(this.option, "") | ||
); | ||
if (expansion[expansion.length - 1] === "-") { | ||
expansion.pop(); | ||
} | ||
return expanded.concat(expansion); | ||
} | ||
return expanded.concat(expansion); | ||
return expanded.concat(arg); | ||
}.bind(this), []); | ||
} | ||
}; |
{ | ||
"name": "posix-argv-parser", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "POSIX compliant command-line argument parser.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://busterjs.org/docs/posix-argv-parser", |
@@ -478,2 +478,7 @@ # posix-argv-parser | ||
**1.0.2** (23.04.2014) | ||
* additional fix for issue [#391](https://github.com/busterjs/buster/issues/391), [not call pop for string arg with trailing dash](https://github.com/busterjs/posix-argv-parser/commit/923797b4896523128586dc901567b4f0ffe2d837) | ||
**1.0.1** (25.03.2014) | ||
@@ -480,0 +485,0 @@ |
@@ -151,4 +151,13 @@ var buster = require("buster-node"); | ||
refute.equals(args, expanded); | ||
}, | ||
"not tries to call pop for string arg with trailing dash": function () { | ||
var sh = shorthand.create("-x", ["--zuul", "dana"]); | ||
var args = ["should-"]; | ||
refute.exception(function () { | ||
sh.expand(args); | ||
}); | ||
} | ||
} | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
104836
2217
488
1