Skip to content
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

Don't require FILE for --config when implicit=False? #26

Open
StevenClontz opened this issue Jun 5, 2021 · 1 comment
Open

Don't require FILE for --config when implicit=False? #26

StevenClontz opened this issue Jun 5, 2021 · 1 comment

Comments

@StevenClontz
Copy link

I'd like something like the following behavior when a configuration file setting name="Universe" is available at the default location, and name="Planet" is available at custom.cfg. In particular, I'd like the user to explicitly ask to load the configuration whenever it's used, but not require them to provide the path to the default location.

$ hello
Hello World!
$ hello --config
Hello Universe!
$ hello --config custom.cfg
Hello Planet!
$ hello --name Multiverse
Hello Multiverse!
$ hello --name Multiverse --config
Hello Multiverse!
@kdeldycke
Copy link

kdeldycke commented Apr 8, 2022

I am maintaining click-extra, which seems to fix your issue as it respect by default the CLI > Configuration > Environment > Defaults precedence.

It also automatically search for a default configuration file in the default application folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants