click
click copied to clipboard
With invoke_without_command set commands are not marked as optional
Having
@click.group(invoke_without_command=True)
def main():
if ctx.invoked_subcommand is not None:
return
# do something by default
I expect --help to output:
Usage: app.py [OPTIONS] [COMMAND] [ARGS]...
But it outputs:
Usage: app.py [OPTIONS] COMMAND [ARGS]...
Environment:
- Python version: 3.11.8
- Click version: 8.2.0
Interesting idea. I am not sure how consistent Click is in its marking optional with brackets in the help pages. I will have to take a look.