config: Refactor parsed option handling

Validate the parsed options directly after read and inform about errors.
This commit is contained in:
Jöran Karl
2024-07-23 22:33:16 +02:00
parent 395d848980
commit 4663927098
4 changed files with 90 additions and 39 deletions

View File

@@ -592,6 +592,10 @@ func doSetGlobalOptionNative(option string, nativeValue interface{}) error {
}
func SetGlobalOptionNative(option string, nativeValue interface{}) error {
if err := config.OptionIsValid(option, nativeValue); err != nil {
return err
}
// check for local option first...
for _, s := range config.LocalSettings {
if s == option {