This commit is contained in:
Denis Zheleztsov 2017-01-09 22:31:35 +03:00
parent 9d33510e27
commit 514fd7bbf4
2 changed files with 22 additions and 2 deletions

11
main.go
View File

@ -13,18 +13,25 @@ var (
tick int
listen string
ws string
v bool
)
func init() {
flag.StringVar(&zk, "zk", "127.0.0.1:2181", "Zookeeper servers comma separated")
flag.StringVar(&zkPath, "zkPath", "/rbmd", "Zookeeper path")
flag.StringVar(&listen, "listen", "0.0.0.0:9076", "HTTP API listen address")
flag.StringVar(&ws, "ws", "0.0.0.0:7690", "Websockets listen address")
flag.StringVar(&listen, "listen", "127.0.0.1:9076", "HTTP API listen address")
flag.StringVar(&ws, "ws", "127.0.0.1:7690", "Websockets listen address")
flag.IntVar(&tick, "tick", 5, "Tick time loop")
flag.BoolVar(&v, "version", false, "Show version info and exit")
flag.Parse()
}
func main() {
if v {
rbmd.VersionShow()
}
config := rbmd.Zk{
strings.Split(zk, ","),
zkPath,

13
src/rbmd/version.go Normal file
View File

@ -0,0 +1,13 @@
package rbmd
import (
"os"
"runtime"
"fmt"
)
//VersionShow show version and exit
func VersionShow() {
fmt.Println("RBMD 0.0.2", runtime.Version(), runtime.GOARCH)
os.Exit(1)
}