diff --git a/main.go b/main.go index 17928f8..a8a75df 100644 --- a/main.go +++ b/main.go @@ -13,19 +13,28 @@ import ( "os/signal" ) +const Version = "pre0.1" + func main() { var port int var host string var driver string var cacheSize int + var version bool flag.IntVar(&port, "port", 6379, "port to bind") flag.StringVar(&driver, "driver", "leveldb", "type of database (leveldb, sqlite)") flag.StringVar(&host, "host", "", "host to bind") flag.IntVar(&cacheSize, "cache", 32, "cache size in MB") + flag.BoolVar(&version, "version", false, "Print version and exit.") flag.Parse() + if version { + fmt.Printf("Version: %s\n", Version) + os.Exit(0) + } + args := flag.Args() if len(args) < 1 {