Update flags

This commit is contained in:
Chandler Swift 2020-03-29 21:02:32 -05:00
parent 4b62cad6bd
commit 53862c4cb0

View file

@ -19,13 +19,13 @@ type serverData struct {
func main() {
serverAddr := flag.String("serverAddr", "factorio.blackolivepineapple.pizza", "Server to check status of (optional, defaults to factorio.bopp")
serverPort := flag.Int("serverport", 34196, "RCON port on the Factorio server")
serverAddr := flag.String("serverAddr", "localhost", "Server to check status of (optional; defaults to localhost")
serverPort := flag.Int("serverPort", 34196, "RCON port on the Factorio server (optional; defaults to 34196)")
password := flag.String("password", "", "RCON password of the server (required)")
flag.Parse()
if *port < 1 || *port > 65535 {
fmt.Printf("Invalid port %v\n", *port)
if *serverPort < 1 || *serverPort > 65535 {
fmt.Printf("Invalid server port %v\n", *serverPort)
return
}
@ -69,7 +69,7 @@ func main() {
t.Execute(w, data)
})
fmt.Printf("Serving on :%v...\n", *port)
http.ListenAndServe(fmt.Sprintf(":%v", *port), nil)
fmt.Println("Serving...")
http.ListenAndServe(":http", nil)
}