vstakhov / libucl

Universal configuration library parser
BSD 2-Clause "Simplified" License
1.63k stars 140 forks source link

The libucl .include macro fails strip the file extension from all but first included file #310

Open Crest opened 2 months ago

Crest commented 2 months ago

The .include(glob=true, prefix=true) "config.d/*.conf" macro only strips the .conf (or .ucl) suffix from the first file matching the config.d/*.conf" pattern. Given files named config.d/blah.conf and config.d/blub.conf it results in the objects blah (suffix correctly stripped) blub.conf (suffix incorrectly retained).

Crest commented 2 months ago

Not a bug, related: it would be useful to make the array of suffixes a parameter with the old default value ['.conf', '.ucl'] as default value. Given an empty array the macro should disable suffix stripping instead of using the default value.