Provide your own complete options. Useful for menu items that don't change.
complete -W "now tomorrow never" echo
Look for direcotries assuming a relative path.
complete -A directory echo
Look for files assuming a relative path.
complete -A file echo
Use a function to generate list of autocomplete values.
_echo_completions() {
COMPREPLY+=("appeal")
COMPREPLY+=("appear")
COMPREPLY+=("append")
COMPREPLY+=("apple")
COMPREPLY+=("apply")
COMPREPLY+=("bend")
}
complete -F _echo_completions echo
Autocalculate completions and filter using what's typed.
_echo_completions() {
COMPREPLY=($(compgen -W "appeal appear append apple apply bend" "${COMP_WORDS[1]}"))
}
complete -F _echo_completions echo
Write environment variables to a file and tail the file from another terminal.
_echo_completions() {
env > tmpfile
COMPREPLY=($(compgen -W "appeal appear append apple apply bend" "${COMP_WORDS[1]}"))
}
complete -F _echo_completions echo