forked from TrueCloudLab/rclone
config: allow keys to be deleted from the config file
This commit is contained in:
parent
ade61fa756
commit
88ef475629
1 changed files with 7 additions and 0 deletions
|
@ -1196,6 +1196,13 @@ func ConfigFileSet(section, key, value string) {
|
||||||
configData.SetValue(section, key, value)
|
configData.SetValue(section, key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConfigFileDeleteKey deletes the config key in the config file.
|
||||||
|
// It returns true if the key was deleted,
|
||||||
|
// or returns false if the section or key didn't exist.
|
||||||
|
func ConfigFileDeleteKey(section, key string) bool {
|
||||||
|
return configData.DeleteKey(section, key)
|
||||||
|
}
|
||||||
|
|
||||||
var matchEnv = regexp.MustCompile(`^RCLONE_CONFIG_(.*?)_TYPE=.*$`)
|
var matchEnv = regexp.MustCompile(`^RCLONE_CONFIG_(.*?)_TYPE=.*$`)
|
||||||
|
|
||||||
// ConfigFileSections returns the sections in the config file
|
// ConfigFileSections returns the sections in the config file
|
||||||
|
|
Loading…
Add table
Reference in a new issue