diff --git a/server/index.js b/server/index.js index e7837f1..20f1702 100644 --- a/server/index.js +++ b/server/index.js @@ -16,15 +16,15 @@ let argv; let branch = ''; const argvStrings = ['host', 'port', 'app-dir', 'lib-dir', 'inpx']; -function showHelp() { +function showHelp(defaultConfig) { console.log(utils.versionText(config)); console.log( `Usage: ${config.name} [options] Options: --help Print ${config.name} command line options - --host= Set web server host, default: 0.0.0.0 - --port= Set web server port, default: 22380 + --host= Set web server host, default: ${defaultConfig.server.host} + --port= Set web server port, default: ${defaultConfig.server.port} --app-dir= Set application working directory, default: /.${config.name} --lib-dir= Set library directory, default: the same as ${config.name} executable's --inpx= Set INPX collection file, default: the one that found in library dir @@ -40,6 +40,8 @@ async function init() { //config const configManager = new (require('./config'))();//singleton await configManager.init(dataDir); + const defaultConfig = configManager.config; + await configManager.load(); config = configManager.config; branch = config.branch; @@ -61,7 +63,7 @@ async function init() { //cli if (argv.help) { - showHelp(); + showHelp(defaultConfig); ayncExit.exit(0); } else { log(utils.versionText(config));