-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (19 loc) · 625 Bytes
/
Copy pathindex.js
File metadata and controls
23 lines (19 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var path = require('path');
var fs = require('fs');
var pkg = require(path.join(process.cwd(), 'package.json'));
var program = require('commander');
var pkginfo = require('pkginfo')(module, 'version'); // jshint ignore:line
var cmdPath = path.join(__dirname, 'lib/commands');
var files = fs.readdirSync(cmdPath);
files.forEach(function(file) {
require(path.join(cmdPath, file))(program, pkg);
});
program
.version(module.exports.version)
.option('-v, --verbose', 'Enable verbose mode.')
.action(function() {
global.verbose = true;
});
program.parse(process.argv);
if(!program.args.length)
program.help();