Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(completions): Address two Bash completion bugs #1770

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions completions/asdf.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
benblank marked this conversation as resolved.
Show resolved Hide resolved
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$versions" -- "$cur"))
else
Expand All @@ -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"))
Expand Down
Loading