-// RegisterCommonOption creates a new option. This is meant to be called by plugins to add options.
-func RegisterCommonOption(name string, defaultvalue interface{}) error {
+func OverwriteSettings(filename string) error {
+ var err error
+ if _, e := os.Stat(ConfigDir); e == nil {
+ txt, _ := json.MarshalIndent(GlobalSettings, "", " ")
+ err = ioutil.WriteFile(filename, append(txt, '\n'), 0644)
+ }
+ return err
+}
+
+// RegisterCommonOptionPlug creates a new option (called pl.name). This is meant to be called by plugins to add options.
+func RegisterCommonOptionPlug(pl string, name string, defaultvalue interface{}) error {
+ name = pl + "." + name