32 lines
495 B
Go
32 lines
495 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
type cmd struct {
|
|
addr string
|
|
port int
|
|
version uint64
|
|
}
|
|
|
|
func ui() *cmd {
|
|
flag.Usage = func() {
|
|
fmt.Printf("Usage of %s:\n", os.Args[0])
|
|
flag.PrintDefaults()
|
|
}
|
|
|
|
addr := flag.String("addr", "127.0.0.1", "Server address")
|
|
port := flag.Int("port", 25565, "Server Port")
|
|
version := flag.Uint64("ver", 751, "Minecraft protocol version number")
|
|
|
|
flag.Parse()
|
|
return &cmd{
|
|
addr: *addr,
|
|
port: *port,
|
|
version: *version,
|
|
}
|
|
}
|