hyperrealm / libconfig

C/C++ library for processing configuration files
https://hyperrealm.github.io/libconfig/
GNU Lesser General Public License v2.1
1.1k stars 360 forks source link

Append to or replace a value previously @included? #177

Closed OJFord closed 3 years ago

OJFord commented 3 years ago

In configuring picom, I'm trying to extend the default system-wide configuration:

@include "/etc/xdg/picom.conf"

shadow-exclude = [
  ...
]

But I cannot overwrite shadow-exclude because a duplicate setting name is an error, and as far as I can tell from the docs/grammar I cannot append new elements to the array, nor remove the included one to replace it.

Ideally I think I'd like a syntax like += for appending to the existing (included) array, but the ability to remove() and replace it in the config file would also be fine, in this case.

thomastrapp commented 3 years ago

This feature is available in current master, via CONFIG_OPTION_ALLOW_OVERRIDES/Config::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.

OJFord commented 3 years ago

Ah, thanks, so that would need to be enabled by picom I assume. I'll ask.. :crossed_fingers: