-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.js
More file actions
30 lines (26 loc) · 678 Bytes
/
mod.js
File metadata and controls
30 lines (26 loc) · 678 Bytes
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
29
30
#!/usr/bin/env node
var utils = require('../lib/utils'),
logger = require('../lib/utils/logger'),
core = require('../lib/core');
var args = process.argv.slice(2);
var cmd = args.shift();
for (var i = 0; i < args.length; i += 1) {
if (args[i] === '--debug') {
args.splice(i, 1);
logger.level = 'debug';
}
}
if (cmd === '-h' || cmd === '--help') {
core.run('help');
}
else if (cmd === '-v' || cmd === '--version') {
utils.getVersion(function (err, ver) {
if (err) {
return logger.error(err);
}
logger.end();
console.log(ver);
});
}else{
core.run(cmd);
}