1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-04 22:09:11 +00:00
spf13--cobra/site/content
Marc Khouzam 24ada7fe71
Remove the default "completion" cmd if it is alone ()
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
..
completions Remove the default "completion" cmd if it is alone () 2025-02-15 11:07:02 -07:00
docgen Replace deprecated ioutil usage () 2024-08-24 07:05:26 -04:00
active_help.md feat: add CompletionWithDesc helper () 2025-02-09 11:06:07 -05:00
projects_using_cobra.md doc: add Conduit () 2025-02-06 15:35:25 -05:00
user_guide.md Allow linker to perform deadcode elimination for program using Cobra () 2025-01-27 09:43:43 -05:00