Reject missing explicit configuration files
This commit is contained in:
committed by
Brandon McGinty
parent
1ea71b1862
commit
6da5b249f9
@@ -129,6 +129,8 @@ func main() {
|
||||
fifo := flag.String("fifo", "", "path of a FIFO from which to read commands")
|
||||
serverSet := false
|
||||
usernameSet := false
|
||||
configSet := false
|
||||
certificateSet := false
|
||||
buffers := flag.Int("buffers", 16, "number of audio buffers to use")
|
||||
profile := flag.Bool("profile", false, "add http server to serve profiles")
|
||||
noiseSuppressionEnabled := flag.Bool("noise-suppression", false, "enable noise suppression for microphone input")
|
||||
@@ -173,19 +175,24 @@ func main() {
|
||||
}()
|
||||
}
|
||||
|
||||
userConfig := config.NewConfig(cfgfn)
|
||||
|
||||
certificateSet := false
|
||||
flag.CommandLine.Visit(func(theFlag *flag.Flag) {
|
||||
switch theFlag.Name {
|
||||
case "server":
|
||||
serverSet = true
|
||||
case "username":
|
||||
usernameSet = true
|
||||
case "config":
|
||||
configSet = true
|
||||
case "certificate":
|
||||
certificateSet = true
|
||||
}
|
||||
})
|
||||
if configSet {
|
||||
if err := config.RequireConfigFile(*cfgfn); err != nil {
|
||||
handle_raw_error(err)
|
||||
}
|
||||
}
|
||||
userConfig := config.NewConfig(cfgfn)
|
||||
|
||||
if !serverSet {
|
||||
server = userConfig.GetDefaultServer()
|
||||
|
||||
Reference in New Issue
Block a user