Skip to content

Commit 9039de8

Browse files
committed
split flag arg by “=“ or “ “; hoist regex
1 parent e5de959 commit 9039de8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎lib/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const EQQ = /\s|=/;
12
const FLAG = /^-{1,2}/;
23
const PREFIX = /^--no-/i;
34
const GROUP = /^-([a-z]{2,})/i;
@@ -86,7 +87,7 @@ module.exports = function(args, opts) {
8687
val.substr(1).split('').forEach(k => out[k] = true);
8788
} else {
8889
let value;
89-
const segs = val.split('=');
90+
const segs = val.split(EQQ);
9091
const key = segs[0].replace(FLAG, '');
9192

9293
if (segs.length > 1) {

0 commit comments

Comments
 (0)