Add tab completion script for zsh

This commit adds a new tab completion script for zsh. It also
fixes the completion script for bash to work with ABS backends.
This commit is contained in:
Jesse Scott 2020-08-21 11:46:10 -07:00
parent b31f44fb40
commit 57e7542f73
No known key found for this signature in database
GPG key ID: 285826E26E0AAD93
2 changed files with 38 additions and 1 deletions

View file

@ -21,7 +21,7 @@ _vmfloaty()
COMPREPLY=( $(compgen -W "${_vmfloaty_avail_templates}" -- "${cur}") )
elif [[ $hostname_subcommands =~ (^| )$prev($| ) ]] ; then
_vmfloaty_active_hostnames=$(floaty list --active 2>/dev/null | grep '^-' | cut -d' ' -f2)
_vmfloaty_active_hostnames=$(floaty list --active --hostnameonly 2>/dev/null)
COMPREPLY=( $(compgen -W "${_vmfloaty_active_hostnames}" -- "${cur}") )
else
COMPREPLY=( $(compgen -W "${subcommands}" -- "${cur}") )