move help text to --help

This commit is contained in:
Manuel Araoz 2014-08-20 15:21:05 -04:00
parent 4dcc246ea5
commit b7f25852d5
2 changed files with 19 additions and 15 deletions

View File

@ -10,11 +10,14 @@ var HistoricSync = require('./lib/HistoricSync');
var express = require('express');
var connect = require('connect');
var program = require('commander');
var config = require('./config/config');
var logger = require('./lib/logger').logger;
program
.version(config.version);
// text title
/*jshint multistr: true */
console.log(
'\n\
____ _ __ __ ___ _ \n\
@ -23,8 +26,9 @@ console.log(
_/ // / / (__ ) / /_/ / / / / /_ / ___ |/ /_/ / / \n\
/___/_/ /_/____/_/\\__, /_/ /_/\\__/ /_/ |_/ .___/_/ \n\
/____/ /_/ \n\
\n\t\t\t\t\t\tv%s\n\
# Configuration:\n\
\n\t\t\t\t\t\tv%s\n', config.version);
program.on('--help', function() {
logger.info('\n# Configuration:\n\
\tINSIGHT_NETWORK (Network): %s\n\
\tINSIGHT_DB (Database Path): %s\n\
\tINSIGHT_SAFE_CONFIRMATIONS (Safe Confirmations): %s\n\
@ -41,18 +45,18 @@ console.log(
\nChange setting by assigning the enviroment variables above. Example:\n\
$ INSIGHT_NETWORK="testnet" BITCOIND_HOST="123.123.123.123" ./insight.js\
\n\n',
config.version,
config.network, config.leveldb, config.safeConfirmations, config.ignoreCache ? 'yes' : 'no',
config.bitcoind.user,
config.bitcoind.pass ? 'Yes(hidden)' : 'No',
config.bitcoind.protocol,
config.bitcoind.host,
config.bitcoind.port,
config.bitcoind.p2pPort,
config.bitcoind.dataDir + (config.network === 'testnet' ? '*' : ''), (config.network === 'testnet' ? '* (/testnet3 is added automatically)' : '')
);
config.network, config.leveldb, config.safeConfirmations, config.ignoreCache ? 'yes' : 'no',
config.bitcoind.user,
config.bitcoind.pass ? 'Yes(hidden)' : 'No',
config.bitcoind.protocol,
config.bitcoind.host,
config.bitcoind.port,
config.bitcoind.p2pPort,
config.bitcoind.dataDir + (config.network === 'testnet' ? '*' : ''), (config.network === 'testnet' ? '* (/testnet3 is added automatically)' : '')
);
});
program.parse(process.argv);
// create express app
var expressApp = express();

View File

@ -57,7 +57,7 @@
"bitcore": "git://github.com/bitpay/bitcore.git#aa41c70cff2583d810664c073a324376c39c8b36",
"bufferput": "git://github.com/bitpay/node-bufferput.git",
"buffertools": "*",
"commander": "*",
"commander": "^2.3.0",
"connect": "^2.25.7",
"connect-ratelimit": "0.0.6",
"express": "~3.4.7",