From 87ae7c73ebe05f777e23087b1550d2cab42746ff Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Wed, 8 Aug 2018 21:55:02 +0100 Subject: Add version string Add `lib.Version` to get updated at build time. Add --version flags to cashier and cashierd Send client version in the signing request Send server version in http response headers and in signing response Set version at build time --- cmd/cashierd/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cmd/cashierd/main.go') diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go index 2e378bc..5b0b390 100644 --- a/cmd/cashierd/main.go +++ b/cmd/cashierd/main.go @@ -2,8 +2,11 @@ package main import ( "flag" + "fmt" "log" + "os" + "github.com/nsheridan/cashier/lib" "github.com/nsheridan/cashier/server" "github.com/nsheridan/cashier/server/config" "github.com/nsheridan/cashier/server/wkfs/vaultfs" @@ -11,11 +14,16 @@ import ( ) var ( - cfg = flag.String("config_file", "cashierd.conf", "Path to configuration file.") + cfg = flag.String("config_file", "cashierd.conf", "Path to configuration file.") + version = flag.Bool("version", false, "Print version and exit") ) func main() { flag.Parse() + if *version { + fmt.Printf("%s\n", lib.Version) + os.Exit(0) + } conf, err := config.ReadConfig(*cfg) if err != nil { log.Fatal(err) -- cgit v1.2.3