beacon_node: "--version" option [skip ci]

fixes #466
This commit is contained in:
Ștefan Talpalaru 2019-11-08 18:35:57 +01:00 committed by Dustin Brody
parent d92d90eb0f
commit c1a63035b9
3 changed files with 9 additions and 2 deletions

View File

@ -915,6 +915,9 @@ when isMainModule:
randomize()
let config = BeaconNodeConf.load(version = fullVersionStr())
if config.showVersion:
quit(QuitSuccess)
when compiles(defaultChroniclesStream.output.writer):
defaultChroniclesStream.output.writer =
proc (logLevel: LogLevel, msg: LogOutputStr) {.gcsafe.} =
@ -929,7 +932,7 @@ when isMainModule:
# workaround for https://github.com/nim-lang/Nim/issues/4057
setupForeignThreadGc()
debug "Shutting down after having received SIGINT"
quit(1)
quit(QuitFailure)
setControlCHook(controlCHandler)
case config.cmd

View File

@ -69,6 +69,10 @@ type
"ETH: $attached_validators_balance"
longform: "status-bar-contents" }: string
showVersion* {.
desc: "Show version and exit."
longform: "version" }: bool
case cmd* {.
command
defaultValue: noCommand }: StartUpCommand

@ -1 +1 @@
Subproject commit d9e815fe670b962ae0a7283d18dc030dc42d8b24
Subproject commit 71643c914110f4549884abd75f22586ee675d98d