Unified handling of printing versions of programs (--version). Setting version to 0.5

This commit is contained in:
Sascha L. Teichmann
2015-07-26 22:04:16 +02:00
parent f6b5f9ce97
commit 62a53dc26b
6 changed files with 44 additions and 3 deletions

View File

@ -25,6 +25,7 @@ func main() {
skipPyramid bool
transparent bool
transparentDim float64
version bool
)
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
@ -51,9 +52,14 @@ func main() {
flag.Float64Var(&transparentDim,
"td", common.DefaultTransparentDim*100.0,
"Extra fimming of transparent nodes each depth meter in percent. (shorthand)")
flag.BoolVar(&version, "version", false, "Print version and exit.")
flag.Parse()
if version {
common.PrintVersionAndExit()
}
if !skipBaseLevel {
td := common.Clamp32f(float32(transparentDim/100.0), 0.0, 1.0)
address := fmt.Sprintf("%s:%d", host, port)