diff --git a/index.js b/index.js index 4378e1d..6f9237a 100644 --- a/index.js +++ b/index.js @@ -195,7 +195,7 @@ module.exports = function (args, opts) { if ( (/[A-Za-z]/).test(letters[j]) - && (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next) + && (/^-?\d+(\.\d*)?(e-?\d+)?$/).test(next) ) { setArg(letters[j], next, arg); broken = true; diff --git a/test/short.js b/test/short.js index 4a7b843..ec06579 100644 --- a/test/short.js +++ b/test/short.js @@ -12,6 +12,11 @@ test('numeric short args', function (t) { ); }); +test('partial numeric short args', function (t) { + t.plan(1); + t.deepEqual(parse(['-n1b3']), { n: true, 1: true, b: 3, _: [] }); +}); + test('short', function (t) { t.deepEqual( parse(['-b']),