I use compgen when $COMP_WORD equals 1, now I want to restore default completion when otherwise,
Right now I have,
_rr()
{
case $COMP_CWORD in
1)
COMPREPLY=($(compgen -W "A B" "${COMP_WORDS[$COMP_CWORD]}"))
;;
esac
}
complete -F _rr rr
Now when $COMP_CWORD is not 1, I got no completion for files / directories, that's the default completion I needed.
Also I need to enable completion only when ${COMP_WORDS[$COMP_CWORD - 1]} is A in this minimal case.