bin: add --version and --help args. fixes #209.
This commit is contained in:
parent
993a27525e
commit
b66f023e22
17
bin/node
17
bin/node
@ -4,6 +4,21 @@
|
|||||||
|
|
||||||
process.title = 'bcoin';
|
process.title = 'bcoin';
|
||||||
|
|
||||||
|
if (process.argv.indexOf('--help') !== -1
|
||||||
|
|| process.argv.indexOf('-h') !== -1) {
|
||||||
|
console.error('See the bcoin wiki at: https://github.com/bcoin-org/bcoin/wiki.');
|
||||||
|
process.exit(1);
|
||||||
|
throw new Error('Could not exit.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv.indexOf('--version') !== -1
|
||||||
|
|| process.argv.indexOf('-v') !== -1) {
|
||||||
|
var pkg = require('../package.json');
|
||||||
|
console.log(pkg.version);
|
||||||
|
process.exit(0);
|
||||||
|
throw new Error('Could not exit.');
|
||||||
|
}
|
||||||
|
|
||||||
var bcoin = require('../');
|
var bcoin = require('../');
|
||||||
var plugin = require('../lib/wallet/plugin');
|
var plugin = require('../lib/wallet/plugin');
|
||||||
var co = bcoin.co;
|
var co = bcoin.co;
|
||||||
@ -23,7 +38,7 @@ node = new bcoin.fullnode({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Temporary hack
|
// Temporary hack
|
||||||
if (!node.has('walletdb'))
|
if (!node.config.bool('no-wallet') && !node.has('walletdb'))
|
||||||
node.use(plugin);
|
node.use(plugin);
|
||||||
|
|
||||||
node.on('error', function(err) {
|
node.on('error', function(err) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user