You can use compgen -fto fill in file names, for example:
if [[ ${prev} == --*file ]] || [[ ${prev} == --out ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
elif ...
However, compgen -fit is not suitable for filling in file names, since it does not fulfill spaces in file names.
_filedir, bash -completion-lib. , (: declare -f _filedir ).
_filedir, :
if [[ ${prev} == --*file ]] || [[ ${prev} == --out ]]; then
_filedir
elif ...