summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-02-27 03:26:26 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-02-27 03:26:26 +0300
commitd32aaa7f7c4c6b6981798513e7b727af34fe4503 (patch)
tree66cd3857789b75871049c5d9c654fe8459acf118 /src
parent2bcdc9c992b486322866f0dfe2b0141ec5d1db7a (diff)
jobd, jobd-master: add --help option
Diffstat (limited to 'src')
-rwxr-xr-xsrc/jobd-master.js10
-rwxr-xr-xsrc/jobd.js10
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)
}