Skip to content

Commit d7125bd

Browse files
author
Paulo Bu
committed
Support for reading stdin
1 parent d555134 commit d7125bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var argv = require('yargs')
4444
describe: 'Diff input source',
4545
nargs: 1,
4646
type: 'string',
47-
choices: ['file', 'command'],
47+
choices: ['file', 'command', 'stdin'],
4848
default: 'command'
4949
}
5050
})
@@ -93,6 +93,8 @@ var argv = require('yargs')
9393
function getInput() {
9494
if (argv.input === 'file') {
9595
return readFile(argv._[0]);
96+
} else if (argv.input === 'stdin') {
97+
return readFile('/dev/stdin');
9698
} else {
9799
var gitArgs;
98100
if (argv._.length && argv._[0]) {

0 commit comments

Comments
 (0)