shelldoor/cmd/shserver/main.go

33 lines
463 B
Go
Raw Normal View History

2024-09-25 22:56:40 +03:00
package main
import (
flags "flag"
"log"
"os"
"surdeus.su/util/shelldoor/servers"
)
func main() {
var (
addr string
)
flags.StringVar(&addr, "addr", ":20000", "address to serve at")
flags.Parse()
args := flags.Args()
if len(args) > 0 {
flags.Usage()
os.Exit(1)
}
server, err := servers.NewServer(addr)
if err != nil {
log.Fatalf("servers.New(...): %s\n", err)
}
log.Printf("Trying to serve at %q\n", addr)
server.ListenAndServe()
}