in config/config.go [335:387]
func (c *Config) UpdateConfig(key string, value string, update bool) {
switch key {
case "prompt":
c.Core.Prompt = value
case "asyncblock":
c.Core.AsyncBlock = value == "true"
case "display":
fallthrough
case "output":
c.Core.Output = value
case "timeout":
intValue, err := strconv.Atoi(value)
if err != nil {
fmt.Println("Error caught while setting timeout:", err)
return
}
c.Core.Timeout = intValue
case "profile":
c.Core.ProfileName = value
c.ActiveProfile = nil
case "url":
c.ActiveProfile.URL = value
case "username":
c.ActiveProfile.Username = value
case "password":
c.ActiveProfile.Password = value
case "domain":
c.ActiveProfile.Domain = value
case "apikey":
c.ActiveProfile.APIKey = value
case "secretkey":
c.ActiveProfile.SecretKey = value
case "verifycert":
c.Core.VerifyCert = value == "true"
case "debug":
if value == "true" || value == "on" {
EnableDebugging()
} else {
DisableDebugging()
}
case "autocomplete":
c.Core.AutoComplete = value == "true"
default:
fmt.Println("Invalid option provided:", key)
return
}
Debug("UpdateConfig key:", key, " value:", value, " update:", update)
if update {
reloadConfig(c, true)
}
}