1
1
Fork 0
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-04-26 17:25:02 +02:00
molly-brown/main.go
Solderpunk eb85a6e94c Another big refactor, splitting the Config struct in two.
The split reflects that between variables which can and cannot be
overridden by .molly files, and this greatly simplifies the
processing of said files, getting rid of the need for lots of
ugly temporary variable thrashing.
2023-02-25 11:29:13 +01:00

37 lines
626 B
Go

// +build js nacl plan9 windows
package main
import (
"flag"
"fmt"
"log"
"os"
)
func main() {
var conf_file string
var version bool
// Parse args
flag.StringVar(&conf_file, "c", "/etc/molly.conf", "Path to config file")
flag.BoolVar(&version, "v", false, "Print version and exit")
flag.Parse()
// If requested, print version and exit
if version {
fmt.Println("Molly Brown version", VERSION)
os.Exit(0)
}
// Read config
sysConfig, userConfig, err := getConfig(conf_file)
if err != nil {
log.Fatal(err)
}
// Run server and exit
var dummy userInfo
os.Exit(launch(sysConfig, userConfig, dummy))
}