Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include overridden #83

Open
rickduoxu opened this issue Oct 3, 2017 · 3 comments
Open

include overridden #83

rickduoxu opened this issue Oct 3, 2017 · 3 comments

Comments

@rickduoxu
Copy link

Have you guys considered a scenario that a base config is included in a subclass config such that a setting can be overridden in the subclass. Currently it throws duplicated parse exception and only stores the setting from the base, the scenario is usefully valid though.

@jD91mZM2
Copy link

I'd absolutely adore this for use in compton. Instead of copy-pasting the default config I could just @include it and override specific settings.

@hyperrealm
Copy link
Owner

It should be fairly easy to make this an option to the parser. Define a new option like CONFIG_OPTION_ALLOW_OVERRIDES. Then just tweak the code in config_setting_add() to check that option and if it's set, and the setting already exists, delete the setting instead of returning NULL.

I probably won't have time to do this myself but if you can create a patch I'll be happy to review it.

@thomastrapp
Copy link
Contributor

Current master (f53e5de) now has the new configuration option CONFIG_OPTION_ALLOW_OVERRIDES / OptionAllowOverrides:

This option controls whether duplicate settings override previous settings
with the same name. If this option is turned off, duplicate settings are
rejected. By default this option is turned off.

I believe this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants