scaleway-cli
scaleway-cli copied to clipboard
Add support for autocomplete behind shim (like asdf)
Description
When using scw behind a version managed using shims like ASDF, the autocomplete doesn't work as it is generating the full path in the generated autocompletion code (even the scw shim is in PATH)
$ scw autocomplete script
autoload -U compinit && compinit
_/home/mpoussin/.asdf/installs/scaleway-cli/2.3.1/bin/scw () {
output=($(/home/mpoussin/.asdf/installs/scaleway-cli/2.3.1/bin/scw autocomplete complete zsh -- ${CURRENT} ${words}))
opts=('-S' ' ')
if [[ $output == *= ]]; then
opts=('-S' '')
fi
compadd "${opts[@]}" -- "${output[@]}"
}
compdef _/home/mpoussin/.asdf/installs/scaleway-cli/2.3.1/bin/scw /home/mpoussin/.asdf/installs/scaleway-cli/2.3.1/bin/scw
It would be interesting to have a --parameter
to force the basename to scw
(or configurable)
How this functionality would be exposed
A new parameter --basename
for example to force a basename on the autocompletion generated code
References
https://github.com/asdf-vm/asdf https://github.com/webofmars/asdf-plugin-scaleway-cli
Version
Version 2.3.1 BuildDate 2021-06-08T11:54:02 GoVersion go1.16.4 GitBranch new-release GitCommit 07dbaebc GoArch amd64 GoOS linux