Socket
Socket
Sign inDemoInstall

posix-argv-parser

Package Overview
Dependencies
0
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

18

lib/shorthand.js

@@ -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);
});
}
}
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc