-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order of configuration file and environment variable value #2
Comments
I have a related concern, but I'll state it a little differently. I did not understand the docs at first glance, and had to read https://github.com/click-contrib/click-configfile/blob/master/click_configfile.py#L468-L499 to figure out what's going on. The first section listed when you construct your own That's great, and the order I want. The problem for me is controlling the other sections in the config file. I really want that precedence of CLI > Configuration file > Environment > Default, but I'm finding it hacky / difficult to achieve. Every other section (not the primary) is loaded as a dict into the This effectively removes the config-provided key from the precedence entirely, to give you just CLI > Environment > Default, plus the value from the config available inside Possible Improvements / Solutions:
Thoughts? |
I stumble upon a similar issue and ended up creating my own extension:
|
I have a click argument set up in the following way:
and I have also configured a corresponding configuration file. This works perfectly.
My only question/concern is whether the order can be determined? Currently, the configuration is read and passed into the commands context so that the configuration file is always preferred over the environment variable.
The text was updated successfully, but these errors were encountered: