From ed1b77ea3b584efa2b67992771be170c1b1e8edb Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 15 Nov 2018 14:51:03 -0500 Subject: [PATCH] Support outputting version with -v flag --- app.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index d9df421..6f2e8f6 100644 --- a/app.go +++ b/app.go @@ -132,13 +132,17 @@ func Serve() { genKeys := flag.Bool("gen-keys", false, "Generate encryption and authentication keys") createSchema := flag.Bool("init-db", false, "Initialize app database") resetPassUser := flag.String("reset-pass", "", "Reset the given user's password") + outputVersion := flag.Bool("v", false, "Output the current version") flag.Parse() debugging = *debugPtr app := &app{} - if *createConfig { + if *outputVersion { + fmt.Println(serverSoftware + " " + softwareVer) + os.Exit(0) + } else if *createConfig { log.Info("Creating configuration...") c := config.New() log.Info("Saving configuration...")