_terraspace() { COMPREPLY=() local word="${COMP_WORDS[COMP_CWORD]}" local words=("${COMP_WORDS[@]}") unset words[0] local completion=$(terraspace completion ${words[@]}) COMPREPLY=( $(compgen -W "$completion" -- "$word") ) } complete -F _terraspace terraspace