-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·24 lines (22 loc) · 725 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env node
let program = require('commander');
let pkg = require('./package');
let fileValue = undefined;
let whitelist = undefined;
program
.version(pkg.version)
.description(pkg.description)
.arguments('<file>')
.option('-w, --whitelist <commands>', 'Add commands to whitelist', (commands)=>commands.split(','))
.action(function(file){
fileValue = file;
});
program.parse(process.argv);
if(typeof fileValue === 'undefined' ||
typeof program.whitelist === 'undefined'){
console.log('altd <file> -w <commands...>');
process.exit(1);
}
let AccessLogTailDispatcher = require('./lib/altd');
let altd = new AccessLogTailDispatcher(fileValue,program.whitelist);
altd.run();