Rename network flag to proto

pull/1/head
maru 2023-12-28 22:08:50 -05:00
parent 9ef76f1064
commit 40c2b50f91
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D
1 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ import (
)
func main() {
network := flag.String("network", "tcp", "network type for server to listen on (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")
dbuser := flag.String("dbuser", "pokerogue", "database username")
@ -28,16 +28,16 @@ func main() {
log.Fatalf("failed to initialize database: %s", err)
}
if *network == "unix" {
if *proto == "unix" {
os.Remove(*address)
}
listener, err := net.Listen(*network, *address)
listener, err := net.Listen(*proto, *address)
if err != nil {
log.Fatalf("failed to create net listener: %s", err)
}
if *network == "unix" {
if *proto == "unix" {
os.Chmod(*address, 0777)
}