mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Add fish completions for which command
This commit is contained in:
parent
bb7f5d031f
commit
728155ccca
@ -26,6 +26,14 @@ function __fish_asdf_arg_at -a number
|
||||
echo $cmd[$number]
|
||||
end
|
||||
|
||||
function __fish_asdf_dir
|
||||
if test -n "$ASDF_DIR"
|
||||
echo $ASDF_DIR
|
||||
else
|
||||
echo "$HOME/.asdf"
|
||||
end
|
||||
end
|
||||
|
||||
# plugin-add completion
|
||||
complete -f -c asdf -n '__fish_asdf_needs_command' -a plugin-add -d "Add git repo as plugin"
|
||||
complete -f -c asdf -n '__fish_asdf_using_command plugin-add; and __fish_asdf_arg_number 2' -a '(asdf plugin-list-all)'
|
||||
@ -64,6 +72,10 @@ complete -f -c asdf -n '__fish_asdf_needs_command' -a where -d "Display install
|
||||
complete -f -c asdf -n '__fish_asdf_using_command where; and __fish_asdf_arg_number 2' -a '(asdf plugin-list)'
|
||||
complete -f -c asdf -n '__fish_asdf_using_command where; and __fish_asdf_arg_number 3' -a '(asdf list (__fish_asdf_arg_at 3))'
|
||||
|
||||
# which completion
|
||||
complete -f -c asdf -n '__fish_asdf_needs_command' -a which -d "Display install path for a shims"
|
||||
complete -f -c asdf -n '__fish_asdf_using_command which; and __fish_asdf_arg_number 2' -a '(ls (__fish_asdf_dir)/shims)'
|
||||
|
||||
# list completion
|
||||
complete -f -c asdf -n '__fish_asdf_needs_command' -a list -d "List installed versions of a package"
|
||||
complete -f -c asdf -n '__fish_asdf_using_command list; and __fish_asdf_arg_number 2' -a '(asdf plugin-list)'
|
||||
|
Loading…
Reference in New Issue
Block a user