click_config_file
click_config_file copied to clipboard
Feature Request: Ability to set the implicit folder
Hello
Currently, click_config_file uses get_app_dir
to find the config file. I would like a way to look either in current folder or on the $HOME folder, for instance (like "#HOME/.myapprc"), or maybe a combination of one or several PATH to look in.
Thanks
Seems like you want an explicit location for the configuration file instead of an implicit one.
You can set any default path you like by setting a parameter:
@configuration_option(default='/some/dir')
It accepts callables as well:
@configuration_option(default=lambda: a if exists(a) else b)
Came across this as well when going through the example from the README. A common pattern is to first look in the current working directory and then through XDG_CONFIG_DIRS
.