Skip to content

Mark commands as optional in the synopsis#3507

Open
kdeldycke wants to merge 1 commit into
pallets:stablefrom
kdeldycke:fix-3059-optional-subcommand-metavar
Open

Mark commands as optional in the synopsis#3507
kdeldycke wants to merge 1 commit into
pallets:stablefrom
kdeldycke:fix-3059-optional-subcommand-metavar

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

@kdeldycke kdeldycke commented May 23, 2026

This PR show optional subcommands in the help screen as [COMMAND] instead of COMMAND.

The bracket syntax is a convention described in POSIX for optional argument and operands. There is no subcommand concept in POSIX, so a subcommand in the context of Click can be considered as an operand as it is positioned after the CLI invokation.

Closes #3059.

@kdeldycke kdeldycke added bug f:command feature: commands f:help feature: help text labels May 23, 2026
@kdeldycke kdeldycke added this to the 8.4.2 milestone May 23, 2026
@kdeldycke kdeldycke changed the base branch from main to stable May 23, 2026 05:31
@kdeldycke kdeldycke force-pushed the fix-3059-optional-subcommand-metavar branch from 3c77550 to 0d62e12 Compare May 23, 2026 05:34
@kdeldycke kdeldycke requested review from Rowlando13 and davidism May 23, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:command feature: commands f:help feature: help text

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