chore: Add --all completion to asdf latest (#1319)

chore: Add --all completion to `asdf latest`
This commit is contained in:
Edwin Kofler 2022-08-22 06:54:10 -07:00 committed by GitHub
parent 5334d1db3d
commit 3208e2e75a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -170,7 +170,9 @@ case "$subcmd" in
;;
(latest)
if (( CURRENT == 3 + IntermediateCount )); then
_asdf__installed_plugins
_alternative \
'all:all:(--all)' \
'asdf-available-plugins:Installed ASDF Plugins:_asdf__installed_plugins'
elif (( CURRENT == 4 + IntermediateCount )); then
local pkg="${words[3+IntermediateCount]}"
local query=${words[4+IntermediateCount]}

View File

@ -67,6 +67,10 @@ _asdf() {
COMPREPLY=($(compgen -W "$plugins" -- "$cur"))
fi
;;
latest)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "--all" -- "$cur"))
;;
*)
local cmds='current global help install list list-all local plugin-add plugin-list plugin-list-all plugin-remove plugin-update reshim shell uninstall update where which info'
# shellcheck disable=SC2207

View File

@ -101,6 +101,7 @@ complete -f -c asdf -n '__fish_asdf_using_command which; and __fish_asdf_arg_num
# latest completion
complete -f -c asdf -n '__fish_asdf_needs_command' -a latest -d "Show latest stable version of a package"
complete -f -c asdf -n '__fish_asdf_using_command latest; and __fish_asdf_arg_number 2' -a '(__fish_asdf_plugin_list)'
complete -f -c asdf -n '__fish_asdf_using_command latest; and __fish_asdf_arg_number 2' -a --all
# list completion
complete -f -c asdf -n '__fish_asdf_needs_command' -a list -d "List installed versions of a package"