doc updates

This commit is contained in:
AJ ONeal 2018-09-22 14:48:39 -06:00
parent 4aaa87fd6c
commit 5512a4dd20
1 changed files with 10 additions and 2 deletions

View File

@ -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);
}