I'll assume that in your real-world case you want to do other things too, and so continue to use `case` constructs (although in this minimal case, `if` constructs would have been sufficient):
_rr()
{
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
case "${COMP_CWORD}" in
1)
COMPREPLY=($(compgen -W "A B" "${cur}"))
;;
esac
case "${prev}" in
A)
COMPREPLY=($(compgen -f "${cur}"))
;;
esac
}
complete -F _rr rr
Documentation of the `-f` option to `compgen` is available in the Bash Reference Manual (scroll down to `file`, under the `-A action` subsection of the description of the `complete` builtin).