Skip to content

Commit

Permalink
Rework -a=bc handling
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Oct 16, 2022
1 parent 1a9a793 commit 2164334
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -149,7 +149,7 @@ module.exports = function (args, opts) {
continue;
}

if (j === 0 && /[A-Za-z]/.test(letters[j]) && next[0] === '=') {
if (/[A-Za-z]/.test(letters[j]) && next[0] === '=') {
setArg(letters[j], next.slice(1), arg);
broken = true;
break;
Expand Down
4 changes: 2 additions & 2 deletions test/kv_short.js
Expand Up @@ -22,9 +22,9 @@ test('short with embedded equals -k=a=b' , function (t) {
t.deepEqual(argv, { k: 'a=b', _: [] });
});

test('short with later equals is not kv like -ab=c' , function (t) {
test('short with later equals like -ab=c' , function (t) {
t.plan(1);

var argv = parse([ '-ab=c' ]);
t.deepEqual(argv, { a: true, b: '=c', _: [] });
t.deepEqual(argv, { a: true, b: 'c', _: [] });
});

0 comments on commit 2164334

Please sign in to comment.