Open van-de-bugger opened 1 month ago
I'm okay in theory with context-sensitive functions, but adding it here would be a breaking change. We should either have this behavior opt-in as a constructor arg (or new api version), or a new method name as you suggested. I'm leaning toward lookup_config_files
and lookup_data_files
. I think we should have both for consistency.
lookup_config_file
returns the first found config file. Sometimes such behavior is not convenient. For example, a config file~/.config/app/app.conf
may define an app configuration only partially, and global config file/etc/xdg/app/app.conf
is still required to get settings, not defined in the~/.config/app/app.conf
. It would be nice iflookup_config_file
returns not only the first found file, but all found files.A possible implementation is trivial:
The two last lines of the function should be:
Alternatively, it could be a set of new functions like
lookup_config_files
orlookup_all_config_files
, if you don't like context-sensitive functions.