Skip to content

Mark invoke_without_command subcommands optional in help#3312

Closed
monsonego wants to merge 1 commit intopallets:mainfrom
monsonego:fix/optional-subcommand-usage
Closed

Mark invoke_without_command subcommands optional in help#3312
monsonego wants to merge 1 commit intopallets:mainfrom
monsonego:fix/optional-subcommand-usage

Conversation

@monsonego
Copy link
Copy Markdown

Summary

  • show the subcommand as optional in group help when invoke_without_command=True
  • add a regression test for the --help output

Why

If a group can be invoked without a subcommand, the usage line should reflect that. Today Click still shows COMMAND [ARGS]... as if a subcommand were required.

Validation

  • PYTHONPATH=src python -m pytest tests/test_commands.py tests/test_chain.py tests/test_formatting.py -q

Fixes #3059

@davidism davidism closed this Apr 5, 2026
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

Successfully merging this pull request may close these issues.

With invoke_without_command set commands are not marked as optional

2 participants