_more_module() { local cur OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" case $cur in -*) OPTS="-d -f -l -p -c -u -s -number -V" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; +*) OPTS="+number +/string" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _more_module more