summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-02 01:53:46 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-02 01:53:46 +0300
commit7f6454c12f12372e0f8332a4d4f02194fc7f48f5 (patch)
tree7956368aa6f72f7b09fc4b7608d10a88034cf61c
parent078f5b8043f0da924676f1ba96937139d7539e3e (diff)
jobd/jobd-master: add --version option
-rwxr-xr-xsrc/jobd-master.js9
-rwxr-xr-xsrc/jobd.js9
2 files changed, 16 insertions, 2 deletions
diff --git a/src/jobd-master.js b/src/jobd-master.js
index d6bc09a..602af9a 100755
--- a/src/jobd-master.js
+++ b/src/jobd-master.js
@@ -4,6 +4,7 @@ const loggerModule = require('./lib/logger')
const config = require('./lib/config')
const {Server, ResponseMessage, RequestMessage} = require('./lib/server')
const WorkersList = require('./lib/workers-list')
+const package_json = require('../package.json')
/**
* @type {Logger}
@@ -43,6 +44,11 @@ async function main() {
process.exit(0)
}
+ if (argv.version) {
+ console.log(package_json.version)
+ process.exit(0)
+ }
+
if (!argv.config)
throw new Error('--config option is required')
@@ -150,7 +156,8 @@ function usage() {
Options:
--config <path>
- --help`
+ --help
+ --version`
console.log(s)
}
diff --git a/src/jobd.js b/src/jobd.js
index 0df4e70..6f3c85e 100755
--- a/src/jobd.js
+++ b/src/jobd.js
@@ -5,6 +5,7 @@ const config = require('./lib/config')
const db = require('./lib/db')
const {Server, Connection, RequestMessage, ResponseMessage} = require('./lib/server')
const {Worker, STATUS_MANUAL} = require('./lib/worker')
+const package_json = require('../package.json')
/**
* @type {Worker}
@@ -49,6 +50,11 @@ async function main() {
process.exit(0)
}
+ if (argv.version) {
+ console.log(package_json.version)
+ process.exit(0)
+ }
+
if (!argv.config)
throw new Error('--config option is required')
@@ -250,7 +256,8 @@ function usage() {
Options:
--config <path>
- --help`
+ --help
+ --version`
console.log(s)
}