diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/jobd-master.js | 10 | ||||
-rwxr-xr-x | src/jobd.js | 10 |
2 files changed, 18 insertions, 2 deletions
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 <path>` + --config <path> + --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 <path>` + --config <path> + --help` + console.log(s) } |