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
This commit is contained in:
Olivier Sallou
2018-10-02 10:40:44 +02:00
parent 0e93d140e8
commit 5d34e1cf38

View File

@@ -44,8 +44,10 @@ Environment varaibles:
CACHET_TOKEN override API token from configuration CACHET_TOKEN override API token from configuration
CACHET_DEV set to enable dev logging` CACHET_DEV set to enable dev logging`
var version string
func main() { 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)) cfg, err := getConfiguration(arguments["--config"].(string))
if err != nil { if err != nil {