diff options
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) |