[Pkg-javascript-commits] [node-minimist] 01/04: Imported Upstream version 1.2.0
Ross Gammon
ross-guest at moszumanska.debian.org
Sun Sep 6 21:42:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
ross-guest pushed a commit to branch master
in repository node-minimist.
commit ecba8928ae51effaaf3e5f43f878f4b02d234039
Author: Ross Gammon <rossgammon at mail.dk>
Date: Sun Sep 6 23:15:02 2015 +0200
Imported Upstream version 1.2.0
---
index.js | 6 ++++++
package.json | 2 +-
test/kv_short.js | 16 ++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/index.js b/index.js
index de61285..6a0559d 100644
--- a/index.js
+++ b/index.js
@@ -140,6 +140,12 @@ module.exports = function (args, opts) {
continue;
}
+ if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
+ setArg(letters[j], next.split('=')[1], arg);
+ broken = true;
+ break;
+ }
+
if (/[A-Za-z]/.test(letters[j])
&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
setArg(letters[j], next, arg);
diff --git a/package.json b/package.json
index 1271939..326480c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "minimist",
- "version": "1.1.3",
+ "version": "1.2.0",
"description": "parse argument options",
"main": "index.js",
"devDependencies": {
diff --git a/test/kv_short.js b/test/kv_short.js
new file mode 100644
index 0000000..f813b30
--- /dev/null
+++ b/test/kv_short.js
@@ -0,0 +1,16 @@
+var parse = require('../');
+var test = require('tape');
+
+test('short -k=v' , function (t) {
+ t.plan(1);
+
+ var argv = parse([ '-b=123' ]);
+ t.deepEqual(argv, { b: 123, _: [] });
+});
+
+test('multi short -k=v' , function (t) {
+ t.plan(1);
+
+ var argv = parse([ '-a=whatever', '-b=robots' ]);
+ t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] });
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-minimist.git
More information about the Pkg-javascript-commits
mailing list