-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathindex.js
29 lines (23 loc) · 930 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
25
26
27
28
29
var program = require("commander");
var fs = require("fs");
var path = require("path");
var package = require('./package.json');
function main() {
var default_host = process.env.ASCH_HOST || '127.0.0.1';
var default_port = process.env.ASCH_PORT || 4096;
program.version(package.version)
.option('-H, --host <host>', 'Specify the hostname or ip of the node, default: ' + default_host, default_host)
.option('-P, --port <port>', 'Specify the port of the node, default: ' + default_port, default_port)
.option('-M, --main', 'Specify the mainnet, default: false')
var plugins = fs.readdirSync(path.join(__dirname, 'plugins'));
plugins.forEach(function (el) {
if (el.endsWith('js')) {
require('./plugins/' + el)(program);
}
});
if (!process.argv.slice(2).length) {
program.outputHelp();
}
program.parse(process.argv);
}
main();