From 5d34e1cf38de7ce6a2563b64e30038d9bd14aa06 Mon Sep 17 00:00:00 2001 From: Olivier Sallou Date: Tue, 2 Oct 2018 10:40:44 +0200 Subject: [PATCH] add version information Sets at build time the version information with -ldflags "-X main.version=3.0.0" for example, the --version will display software version --- cli/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/main.go b/cli/main.go index 5cb5a70..2ac47ce 100644 --- a/cli/main.go +++ b/cli/main.go @@ -44,8 +44,10 @@ Environment varaibles: CACHET_TOKEN override API token from configuration CACHET_DEV set to enable dev logging` +var version string + func main() { - arguments, _ := docopt.Parse(usage, nil, true, "cachet-monitor", false) + arguments, _ := docopt.Parse(usage, nil, true, version, false) cfg, err := getConfiguration(arguments["--config"].(string)) if err != nil {