6

Configure autocomplete for the first argument, leave the others alone

view full story
linux-howto

http://unix.stackexchange.com – I have a utility that takes a load of different arguments. For now, I want to autocomplete the first argument, but leave all the others to fall through to normal autocompletion. How do I do that? function _my_autocomplete_() { case $COMP_CWORD in 1) COMPREPLY=($(compgen -W "$(get_args_somehow)" -- ${COMP_WORDS[COMP_CWORD]}));; *) # What goes here? esac } complete -F _my_autocomplete_ mycommand (HowTos)