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

@ -31,6 +31,7 @@ func main() {
updateHosts string
websockets bool
playersFIFO string
version bool
)
flag.IntVar(&webPort, "web-port", 8808, "port of the web server")
flag.IntVar(&webPort, "p", 8808, "port of the web server (shorthand)")
@ -63,9 +64,14 @@ func main() {
flag.BoolVar(&websockets, "ws", false, "Forward tile changes to clients via websockets (shorthand).")
flag.StringVar(&playersFIFO, "players", "", "Path to FIFO file to read active players from.")
flag.StringVar(&playersFIFO, "ps", "", "Path to FIFO file to read active players from (shorthand).")
flag.BoolVar(&version, "version", false, "Print version and exit.")
flag.Parse()
if version {
common.PrintVersionAndExit()
}
router := mux.NewRouter()
subBaseLine := newSubBaseLine(mapDir)