Add interactive configuration

This adds a new --config flag and rearranges some config fields.
This commit is contained in:
Matt Baer
2018-10-25 09:15:10 -04:00
parent 6bdb7a1c1c
commit cc224db6e6
4 changed files with 250 additions and 13 deletions

8
app.go
View File

@@ -36,6 +36,7 @@ var shttp = http.NewServeMux()
func Serve() {
createConfig := flag.Bool("create-config", false, "Creates a basic configuration and exits")
doConfig := flag.Bool("config", false, "Run the configuration process")
flag.Parse()
if *createConfig {
@@ -48,6 +49,13 @@ func Serve() {
os.Exit(1)
}
os.Exit(0)
} else if *doConfig {
err := config.Configure()
if err != nil {
log.Error("Unable to configure: %v", err)
os.Exit(1)
}
os.Exit(0)
}
log.Info("Initializing...")