Allow using wildcards in config include paths

Updates `Config::tryExpandPath()` to return a vector of expanded path
matches instead of a single path wrapped in an optional, with an empty
vector indicating no matches.

`Config::resolveConfigIncludes()` iterates over all of these matches,
while other instances of path expansion (such as finding the base config
path) retain their existing behavior and only use the first match.
This commit is contained in:
Ethan Martin
2025-01-02 20:50:39 -05:00
parent ac08b752e3
commit d1dac2854a
3 changed files with 24 additions and 18 deletions

View File

@ -20,8 +20,8 @@ class Config {
static std::optional<std::string> findConfigPath(
const std::vector<std::string> &names, const std::vector<std::string> &dirs = CONFIG_DIRS);
static std::optional<std::string> tryExpandPath(const std::string &base,
const std::string &filename);
static std::vector<std::string> tryExpandPath(const std::string &base,
const std::string &filename);
Config() = default;