Skip to content

Commit

Permalink
handle joined single letters
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Senior authored and James Halliday committed Feb 21, 2014
1 parent fa63ed4 commit 66c248f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports = function (args, opts) {
break;
}
else {
setArg(letters[j], true);
setArg(letters[j], flags.strings[letters[j]] ? '' : true);
}
}

Expand Down
7 changes: 4 additions & 3 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ test('empty strings', function(t) {
t.equal(str, '');
t.equal(typeof str, 'string');

var letters = parse([ '-at' ], {
string: 't'
var letters = parse([ '-art' ], {
string: [ 'a', 't' ]
});

t.equal(letters.a, true);
t.equal(letters.a, '');
t.equal(letters.r, true);
t.equal(letters.t, '');

t.end();
Expand Down

0 comments on commit 66c248f

Please sign in to comment.