blob: 6f3eb57d1b1fb2a7f098e18eb4cb818c2c480c44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env node
var handleInput = require('../lib/handleInput');
var options = {};
if (process.argv[2]) {
if (~['-v', '--verbose'].indexOf(process.argv[2])) {
options.verbose = true;
if (process.argv[3]) {
options.filepath = process.argv[3];
}
} else {
options.filepath = process.argv[2];
}
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
var input = '';
process.stdin.on('data', function(chunk) {
input += chunk;
});
process.stdin.on('end', function() {
handleInput(input, options);
});
|