_ganeti_destroy-commands(){ local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts=$(jq .instances[].name -r /var/lib/ganeti/config.data) COMPREPLY=( $(compgen -W "$opts" -- ${cur}) ) return 0 } complete -F _ganeti_destroy-commands destroy