Commit graph

4 commits

Author SHA1 Message Date
Marc Khouzam
24ada7fe71
Remove the default "completion" cmd if it is alone (#1559)
When a program has no sub-commands, its root command can accept
arguments.  If we add the default "completion" command to such programs
they will now have a sub-command and will no longer accept arguments.

What we do instead for this special case, is only add the "completion"
command if it is being called, or if it is being completed itself.

We want to have the "completion" command for such programs because it
will allow the completion of flags and of arguments (if provided
by the program).

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
2025-02-15 11:07:02 -07:00
ccoVeille
8cb30f9ca5
feat: add CompletionWithDesc helper (#2231)
The code has also been refactored to use a type alias for completion and a completion helper

Using a type alias is a non-breaking change and it makes the code more readable and easier to understand.

Signed-off-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: Marc Khouzam <marc.khouzam@gmail.com>
2025-02-09 11:06:07 -05:00
Ville Skyttä
e63925d321
Add env variable to suppress completion descriptions on create (#1938)
COBRA_COMPLETION_DESCRIPTIONS=0 
or 
<PROGRAM>_COMPLETION_DESCRIPTIONS=0
can now be used to disable shell completion descriptions.
2023-12-17 13:50:59 -05:00
Unai Martinez-Corral
dcb405a939
Move documentation sources to site/content (#1428) 2023-06-20 17:15:36 -04:00