Instantly quit if it's not possible to read the config file.

http_upload
Martin Dosch 4 years ago
parent bf4ec88e00
commit ee7bf1fb71

@ -208,11 +208,12 @@ func main() {
recipients[i] = validatedJid
}
// Read configuration file if user, server or password is not specified.
if *flagUser == "" || *flagServer == "" || *flagPassword == "" {
// Read configuration from file.
config, err := parseConfig(*flagFile)
if err != nil {
log.Println("Error parsing ", *flagFile, ": ", err)
log.Fatal("Error parsing ", *flagFile, ": ", err)
}
// Set connection options according to config.
user = config.username

Loading…
Cancel
Save