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

@ -28,6 +28,7 @@ func main() {
transparent bool
cpuProfile string
transparentDim float64
version bool
)
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
@ -51,9 +52,14 @@ func main() {
&transparentDim, "transparent-dim", common.DefaultTransparentDim*100,
"Extra dimming of transparent nodes every depth meter in percent (0-100).")
flag.StringVar(&cpuProfile, "cpuprofile", "", "write cpu profile to file")
flag.BoolVar(&version, "version", false, "Print version and exit.")
flag.Parse()
if version {
common.PrintVersionAndExit()
}
if cpuProfile != "" {
f, err := os.Create(cpuProfile)
if err != nil {