mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-17 03:25:33 +00:00
Instantly quit if it's not possible to read the config file.
This commit is contained in:
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…
Reference in New Issue
Block a user