mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-25 15:40:22 +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"
|
"os/signal"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const Version = "pre0.1"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
var port int
|
var port int
|
||||||
var host string
|
var host string
|
||||||
var driver string
|
var driver string
|
||||||
var cacheSize int
|
var cacheSize int
|
||||||
|
var version bool
|
||||||
|
|
||||||
flag.IntVar(&port, "port", 6379, "port to bind")
|
flag.IntVar(&port, "port", 6379, "port to bind")
|
||||||
flag.StringVar(&driver, "driver", "leveldb", "type of database (leveldb, sqlite)")
|
flag.StringVar(&driver, "driver", "leveldb", "type of database (leveldb, sqlite)")
|
||||||
flag.StringVar(&host, "host", "", "host to bind")
|
flag.StringVar(&host, "host", "", "host to bind")
|
||||||
flag.IntVar(&cacheSize, "cache", 32, "cache size in MB")
|
flag.IntVar(&cacheSize, "cache", 32, "cache size in MB")
|
||||||
|
flag.BoolVar(&version, "version", false, "Print version and exit.")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if version {
|
||||||
|
fmt.Printf("Version: %s\n", Version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
|
Loading…
Reference in New Issue
Block a user