cleo icon indicating copy to clipboard operation
cleo copied to clipboard

completions command cannot generate completions for subcommands

Open zevisert opened this issue 4 years ago • 1 comments

The completions command added in https://github.com/sdispater/cleo/commit/c0048bb5ad10af929dd2883a98f74aede5ba6e80 uses a one-level-deep template. There is no room in this template to generate completions for subcommands in a given context, so in general this means scenarios like the following cannot have completions generated for them.

[program] command subcommand --<tab>

This comes from python-poetry, where no completions exist for poetry env <tab> or poetry env list --<tab>

zevisert avatar Sep 14 '20 21:09 zevisert

Just ran on this problem while using fish shell:

poetry completions fish | fish

Output:

complete: too many arguments

Standard input (line 25):
complete -c poetry -f -n '__fish_poetry_e83f4a1a4a219fe0_complete_no_subcommand' -a cache clear -d 'Clears Poetry\'s cache.'
^

(Type 'help complete' for related documentation)
complete: too many arguments

Standard input (line 26):
complete -c poetry -f -n '__fish_poetry_e83f4a1a4a219fe0_complete_no_subcommand' -a cache list -d 'List Poetry\'s caches.'
^
...

Since I've installed poetry via brew, I constantly see errors after I hit "poetry " + <TAB>

Maybe disable generating commands which contain subcommands as temporary solution ?

dinkopehar avatar Sep 22 '22 22:09 dinkopehar

The issue mentioned by dinko-pehar (purposely not notifying since it's an old post) is addressed by the commit in https://github.com/python-poetry/poetry/issues/5929.

When I run this command: poetry completions fish | fish, I see the list of commands that fixed by issue 5929.

drin avatar Jul 18 '23 16:07 drin