You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mir/serve.go

25 lines
495 B
Go

package main
import (
"flag"
"orel.li/mir/internal/ref"
)
func serve(args []string) {
path := "./mir.sock"
rootDir := "/srv/mir"
serveFlags := flag.NewFlagSet("serve", flag.ExitOnError)
serveFlags.StringVar(&path, "l", path, "path for a unix domain socket to listen on")
serveFlags.StringVar(&rootDir, "root", rootDir, "root directory for module storage")
serveFlags.Parse(args)
h := handler{
path: ref.New(&path),
}
if err := h.run(); err != nil {
bail(1, err.Error())
}
}