Rename address flag to addr

pull/1/head
maru 11 months ago
parent 40c2b50f91
commit b64ae0bf47
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D

@ -13,7 +13,7 @@ import (
func main() { func main() {
proto := flag.String("proto", "tcp", "protocol for api to use (tcp, unix)") proto := flag.String("proto", "tcp", "protocol for api to use (tcp, unix)")
address := flag.String("address", "0.0.0.0", "network address for server to listen on") addr := flag.String("addr", "0.0.0.0", "network address for server to listen on")
dbuser := flag.String("dbuser", "pokerogue", "database username") dbuser := flag.String("dbuser", "pokerogue", "database username")
dbpass := flag.String("dbpass", "", "database password") dbpass := flag.String("dbpass", "", "database password")
@ -29,16 +29,16 @@ func main() {
} }
if *proto == "unix" { if *proto == "unix" {
os.Remove(*address) os.Remove(*addr)
} }
listener, err := net.Listen(*proto, *address) listener, err := net.Listen(*proto, *addr)
if err != nil { if err != nil {
log.Fatalf("failed to create net listener: %s", err) log.Fatalf("failed to create net listener: %s", err)
} }
if *proto == "unix" { if *proto == "unix" {
os.Chmod(*address, 0777) os.Chmod(*addr, 0777)
} }
// account // account

Loading…
Cancel
Save