Open brutog opened 2 years ago
Could you please provide a minimal example to reproduce this?
Sure. This should reproduce:
import click
import click_config_file
@click.group(context_settings=dict(show_default=True))
@click.pass_context
@click_config_file.configuration_option(default='/tmp/.configfile')
def cli(ctx):
pass
I'll look into this. For now you can fix it by passing @click_config_file.configuration_option(default='/tmp/.configfile', implicit=False)
When using the option to show defaults in help text:
@click.group(context_settings=dict(show_default=True))
I see a bad behavior. When the tool is invoked with
--help
, it has the wrong path for the config file:If the tool is invoked without
--help
, or any command at all, such that the help is forced to display, I see the right default for the configuration file:This could be confusing for users.