[core/completion] Support scalar `COMPREPLY` with `compgen -F` (#2212)