feat(info): add --version cmd flag (#970)

This commit is contained in:
Daniel Kaiser 2022-05-17 22:11:07 +02:00 committed by GitHub
parent 42f48a6892
commit 41cdb8ba26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,11 @@ type
desc: "Sets the log level."
defaultValue: LogLevel.INFO
name: "log-level" }: LogLevel
version* {.
desc: "prints the version"
defaultValue: false
name: "version" }: bool
nodekey* {.
desc: "P2P node private key as 64 char hex string.",

View File

@ -1306,6 +1306,12 @@ when isMainModule:
quit 1 # if we don't leave here, the initialization of conf does not work in the success case
{.pop.}
# if called with --version, print the version and quit
if conf.version:
const git_version {.strdefine.} = "n/a"
echo "version / git commit hash: ", git_version
quit(QuitSuccess)
var
node: WakuNode # This is the node we're going to setup using the conf