You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With invoke_without_command set, commands are not marked as optionalย #3059
Current help pages are reasonable. In the short term, a lot of effort effort is needs to go to making our api less public in a way that is reasonable to users. So closing for now.
changed the title [-]With invoke_without_command set commands are not marked as optional[/-][+]With `invoke_without_command` set, commands are not marked as optional[/+]on May 22, 2026
Went down the rabbit hole yesterday and found out that 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. So yes, we should use [COMMAND] in this case.
Activity
Rowlando13 commentedon Sep 14, 2025
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.
Rowlando13 commentedon May 19, 2026
Current help pages are reasonable. In the short term, a lot of effort effort is needs to go to making our api less public in a way that is reasonable to users. So closing for now.
kdeldycke commentedon May 22, 2026
@Rowlando13 to be honest I like the visual hint that command is optional. And looks like we have an easy PR in line at #3271 that I can take over.
I'm in favor of re-opening this issue.
[-]With invoke_without_command set commands are not marked as optional[/-][+]With `invoke_without_command` set, commands are not marked as optional[/+]Rowlando13 commentedon May 23, 2026
If you are interested, then by all means!
kdeldycke commentedon May 23, 2026
Went down the rabbit hole yesterday and found out that 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. So yes, we should use
[COMMAND]in this case.Mark commands as optional in the synopsis
Mark commands as optional in the synopsis
kdeldycke commentedon May 27, 2026
This has been fixed by: #3507