/bash_completion_lib/complete -o filenames/mc
http://github.com/brinkman83/bashrc · #! · 44 lines · 36 code · 8 blank · 0 comment · 0 complexity · 4dfdbb314d331863daef27d45f594dd7 MD5 · raw file
- # mc(1) completion
- comp_include _filedir _get_cword
- _mc()
- {
- local cur prev
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
- # -name value style option
- case "$prev" in
- -@(e|v|l|P))
- _filedir
- return 0
- ;;
- esac
- # --name=value style option
- if [[ "$cur" == *=* ]]; then
- prev=${cur/=*/}
- cur=${cur/*=/}
- case "$prev" in
- --@(edit|view|ftplog|printwd))
- _filedir
- return 0
- ;;
- esac
- fi
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-a --stickchars -b --nocolor -c \
- --color -C --colors= -d --nomouse -e --edit= -f \
- --datadir -k --resetsoft -l --ftplog= -P --printwd= \
- -s --slow -t --termcap -u --nosubshell -U --subshell \
- -v --view= -V --version -x --xterm -h --help' -- $cur ) )
- else
- _filedir -d
- fi
- } # _mc()