diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-08 21:55:02 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-10 18:35:13 +0100 |
commit | 87ae7c73ebe05f777e23087b1550d2cab42746ff (patch) | |
tree | 45e4ea4ce48385ebbb9ba83447bfb5d66d97dea7 /cmd/cashierd | |
parent | 3e006c39b0a4411e91e80de261d0e7b5353d44c0 (diff) |
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
Diffstat (limited to 'cmd/cashierd')
-rw-r--r-- | cmd/cashierd/main.go | 10 |
1 files changed, 9 insertions, 1 deletions
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) |