-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (29 loc) · 714 Bytes
/
main.go
File metadata and controls
33 lines (29 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"flag"
"fmt"
"log"
"os"
srvConfig "github.com/CHESSComputing/golib/config"
)
func main() {
var version bool
flag.BoolVar(&version, "version", false, "Show version")
cfile := os.Getenv("FOXDEN_CONFIG")
var config string
flag.StringVar(&config, "config", cfile, "server config file, default $FOXDEN_CONFIG")
flag.Parse()
if version {
fmt.Println("server version:", srvConfig.Info())
return
}
if cobj, err := srvConfig.ParseConfig(config); err == nil {
srvConfig.Config = &cobj
} else {
log.Fatal(fmt.Sprintf("Unable to parse config='%s'\nerror: %v", config, err))
}
if srvConfig.Config.SpecScans.WebServer.Verbose > 0 {
log.SetFlags(log.Llongfile)
}
Server()
}