From d32aaa7f7c4c6b6981798513e7b727af34fe4503 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 27 Feb 2021 03:26:26 +0300 Subject: jobd, jobd-master: add --help option --- src/jobd-master.js | 10 +++++++++- src/jobd.js | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/jobd-master.js b/src/jobd-master.js index 0c33942..54e2377 100755 --- a/src/jobd-master.js +++ b/src/jobd-master.js @@ -39,6 +39,12 @@ async function main() { process.on('SIGTERM', term) const argv = minimist(process.argv.slice(2)) + + if (argv.help) { + usage() + process.exit(0) + } + if (!argv.config) throw new Error('--config option is required') @@ -139,7 +145,9 @@ function usage() { let s = `${process.argv[1]} OPTIONS Options: - --config ` + --config + --help` + console.log(s) } diff --git a/src/jobd.js b/src/jobd.js index 6db98fe..457c029 100755 --- a/src/jobd.js +++ b/src/jobd.js @@ -46,6 +46,12 @@ async function main() { process.on('SIGTERM', term) const argv = minimist(process.argv.slice(2)) + + if (argv.help) { + usage() + process.exit(0) + } + if (!argv.config) throw new Error('--config option is required') @@ -233,7 +239,9 @@ function usage() { let s = `${process.argv[1]} OPTIONS Options: - --config ` + --config + --help` + console.log(s) } -- cgit v1.2.3