Add interactive configuration
This adds a new --config flag and rearranges some config fields.
This commit is contained in:
8
app.go
8
app.go
@@ -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...")
|
||||
|
Reference in New Issue
Block a user