-
Notifications
You must be signed in to change notification settings - Fork 873
Description
I'm working on a system that allows for merging TOML files together. For example you could have a "Base" config and a platform specific "Override" config.
For scalars it's easy -- overwrite the old value. For arrays it's tricky though because we want the ability to add and remove elements.
I'd like the ability to prefix a key or table name with + to indicate it should be added to an existing array, or - to indicate it should be removed. For example:
[table]
+key=[ "These elements", " are added to an existing key" ]
-key=[ "These elements", " are removed from an existing key" ]
I can do it right now by enclosing the name in quotes, but it would be really nice to specify them with bare keys.
Alternatively, TOML could support explicit merging with += and -= operators, but that seems like a much bigger change.