mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 01:10:17 +01:00
Added version flag for command line.
This commit is contained in:
parent
3f97399a82
commit
66b85f199c
9
main.go
9
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user