cli-argparse
Advanced tools
Comparing version
@@ -42,3 +42,4 @@ var short = '-', long = '--'; | ||
var flag = (!next && !~equals) | ||
|| (next && next.indexOf(short) == 0 && !~equals); | ||
|| (next && (next.indexOf(short) == 0 && next != short) && !~equals); | ||
if(next == short) output.stdin = true; | ||
if(~equals) { | ||
@@ -45,0 +46,0 @@ value = arg.slice(equals + 1); arg = arg.slice(0, equals); |
{ | ||
"name": "cli-argparse", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"description": "Lightweight argument parser", | ||
@@ -5,0 +5,0 @@ "author": "muji <noop@xpm.io>", |
@@ -26,2 +26,10 @@ var expect = require('chai').expect; | ||
}); | ||
it('should accept stdin as value', function(done) { | ||
var args = ['--file', '-']; | ||
var result = parse(args); | ||
expect(result.raw).to.eql(args); | ||
expect(result.stdin).to.eql(true); | ||
expect(result.options.file).to.eql('-'); | ||
done(); | ||
}); | ||
}) |
19259
1.66%416
2.21%