Open seanhamlin opened 5 months ago
Huh, completion must have snuck in when I upgraded cobra a while back. Will need time to investigate, there may be limitation to what cobra provides, or how we do things that prevent it from working as intended.
It seems to do arguments for me with bash
? perhaps a zsh
thing?
If I type:
$ lagoon ad
...and then press tab, I get
-bash: _get_comp_words_by_ref: command not found
HTH,
I can't reproduce that behaviour, it works fine for me, so not sure where to even start here. Did your completion script get truncated, or are you sourcing it properly?
The shell completion scripts are not controlled by the lagoon-cli, but by cobra
the underlying command library we use. So if there is a bug there, then I can't really help much.
@tnelson-doghouse Shell completion in bash relies on functions defined in the bash-completion
library. I guess either you don't have bash-completion
installed (that's what the package is called on Debian, not sure for other OS), or your .bashrc
is missing this snippet.
Thanks @smlx ! Works for me now.
For the record, on Fedora I did:
sudo dnf install bash-completion
So it seems the remaining issues here are:
HTH,
+1 for better support (on ZSH)
Is your feature request related to a problem? Please describe.
I would love shell completion for all Lagoon CLI commands and arguments.
Describe the solution you'd like
I believe Cobra has basic support for this
However, this does not list the arguments from what I can tell.
It would also be nice to have documentation about this, perhaps around the installation instructions.