mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-23 11:55:13 -07:00
fix(completions): Address two Bash completion bugs (#1770)
Co-authored-by: Trevor Brown <Stratus3D@users.noreply.github.com>
This commit is contained in:
parent
bd19e4cbdc
commit
ebdb229ce6
@ -39,7 +39,7 @@ _asdf() {
|
||||
COMPREPLY=($(compgen -W "$available_plugins" -- "$cur"))
|
||||
;;
|
||||
install | list | list-all | help)
|
||||
if [[ "$plugins" == *"$prev"* ]]; then
|
||||
if [[ " $plugins " == *" $prev "* ]]; then
|
||||
local versions
|
||||
versions=$(asdf list-all "$prev" 2>/dev/null)
|
||||
# shellcheck disable=SC2207
|
||||
@ -54,9 +54,10 @@ _asdf() {
|
||||
COMPREPLY=($(compgen -W "--head" -- "$cur"))
|
||||
;;
|
||||
uninstall | where | reshim)
|
||||
if [[ "$plugins" == *"$prev"* ]]; then
|
||||
if [[ " $plugins " == *" $prev "* ]]; then
|
||||
local versions
|
||||
versions=$(asdf list "$prev" 2>/dev/null)
|
||||
# The first two columns are either blank or contain the "current" marker.
|
||||
versions=$(asdf list "$prev" 2>/dev/null | colrm 1 2)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$versions" -- "$cur"))
|
||||
else
|
||||
@ -65,9 +66,10 @@ _asdf() {
|
||||
fi
|
||||
;;
|
||||
local | global | shell)
|
||||
if [[ "$plugins" == *"$prev"* ]]; then
|
||||
if [[ " $plugins " == *" $prev "* ]]; then
|
||||
local versions
|
||||
versions=$(asdf list "$prev" 2>/dev/null)
|
||||
# The first two columns are either blank or contain the "current" marker.
|
||||
versions=$(asdf list "$prev" 2>/dev/null | colrm 1 2)
|
||||
versions+=" system"
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$versions" -- "$cur"))
|
||||
|
Loading…
Reference in New Issue
Block a user