From 5512a4dd20090db75b43aaa586f5fe9fa7f1db9e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 22 Sep 2018 14:48:39 -0600 Subject: [PATCH] doc updates --- bin/telebit-remote.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/telebit-remote.js b/bin/telebit-remote.js index 0bd21d7..996c8a5 100755 --- a/bin/telebit-remote.js +++ b/bin/telebit-remote.js @@ -46,7 +46,13 @@ if (-1 !== argIndex) { } function help() { - console.info(TPLS.remote.help.main.replace(/{version}/g, pkg.version)); + var keys = Object.keys(TPLS.remote.help).filter(function (key) { + return 'main' !== key; + }); + var key = keys.filter(function (key) { + return -1 !== process.argv.indexOf(key); + })[0] || 'main'; + console.info(TPLS.remote.help[key].replace(/{version}/g, pkg.version)); } var verstr = [ pkg.name + ' remote v' + pkg.version ]; @@ -55,7 +61,9 @@ if (!confpath) { verstr.push('(--config \'' + confpath.replace(new RegExp('^' + os.homedir()), '~') + '\')'); } -if (-1 !== argv.indexOf('-h') || -1 !== argv.indexOf('--help')) { +if ([ '-h', '--help', 'help' ].some(function (arg) { + return -1 !== argv.indexOf(arg); +})) { help(); process.exit(0); }