I don’t like so much how SAVE_CONFIG handles my printer.cfg
file, commenting overrode properties, and appending a magic commented block with a magic header.
Additionally, there is a “feature” that only allows you to override a config property only if it’s defined directly in the config.cfg
file, but not in an include.
I think, a much simplier approach, would be to store that overrode config in a separated file, with the same syntax as original. The file could be named printer.override.cfg
(like Docker does with docker-compose.yml
and docker-compose.override.cfg
files), or similar.
That new file could have a header, warning users that it’s autogenerated and shouldn’t be manually modified.
Load config process would be done in 2 steps:
- Load config from
printer.cfg
file. - Override properties from
printer.override.cfg
file, if present.
Save config process would simply create or recreate the printer.override.cfg
file with the new values.
I understand that it could create confusion with some users, looking at config in printer.cfg
, and thinking that a parameter is configured to some value, but the current value is different beacuse is overrode in another file; but I think it could be “easily” managed in the frontend’s editor.
This approach would allow to override config defined in included files, and to ignore the automated changes if you don’t want to store them in a repository. I think it could also simply the config parsing, as no magic block are involved.
What do you think?