click_config_file icon indicating copy to clipboard operation
click_config_file copied to clipboard

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

Open StevenClontz opened this issue 3 years ago • 1 comments

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!

StevenClontz avatar Jun 05 '21 03:06 StevenClontz

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.

kdeldycke avatar Apr 08 '22 19:04 kdeldycke