config: don't offer hidden values for editing in the config - fixes #3416

This commit is contained in:
Nick Craig-Wood 2019-08-10 15:27:32 +01:00
parent 6812844b3d
commit 23a0332185

View file

@ -1072,12 +1072,13 @@ func editOptions(ri *fs.RegInfo, name string, isNew bool) {
} }
} }
for _, option := range ri.Options { for _, option := range ri.Options {
hasAdvanced = hasAdvanced || option.Advanced isVisible := option.Hide&fs.OptionHideConfigurator == 0
hasAdvanced = hasAdvanced || (option.Advanced && isVisible)
if option.Advanced != advanced { if option.Advanced != advanced {
continue continue
} }
subProvider := getConfigData().MustValue(name, fs.ConfigProvider, "") subProvider := getConfigData().MustValue(name, fs.ConfigProvider, "")
if matchProvider(option.Provider, subProvider) { if matchProvider(option.Provider, subProvider) && isVisible {
if !isNew { if !isNew {
fmt.Printf("Value %q = %q\n", option.Name, FileGet(name, option.Name)) fmt.Printf("Value %q = %q\n", option.Name, FileGet(name, option.Name))
fmt.Printf("Edit? (y/n)>\n") fmt.Printf("Edit? (y/n)>\n")
@ -1085,9 +1086,7 @@ func editOptions(ri *fs.RegInfo, name string, isNew bool) {
continue continue
} }
} }
if option.Hide&fs.OptionHideConfigurator == 0 { FileSet(name, option.Name, ChooseOption(&option, name))
FileSet(name, option.Name, ChooseOption(&option, name))
}
} }
} }
} }