diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2009-05-22 00:22:48 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2009-05-22 00:22:48 +0300 |
commit | 402a0706a586c831449a122bda6aaf5fee125a94 (patch) | |
tree | 1c256a5af921bb5e974637a9934958618380f1e8 /contrib/mc | |
parent | cc66ec76f593cc7f15105917b565731c061c68ab (diff) | |
download | bash-completion-402a0706a586c831449a122bda6aaf5fee125a94.tar.gz |
Use _split_longopt with mc, other small mc option completion improvements.
Diffstat (limited to 'contrib/mc')
-rw-r--r-- | contrib/mc | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -6,38 +6,38 @@ have mc && _mc() { - local cur prev + local cur prev split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - # -name value style option + _split_longopt && split=true + case "$prev" in - -@(e|v|l|P)) + -e|--edit|-v|--view|-l|--ftplog|-P|--printwd) _filedir return 0 ;; + -C|--colors|-D|--debuglevel) + # argument required but no completions available + return 0 + ;; + -h|--help|-V|--version) + # all other arguments are noop with these + 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 + $split && return 0 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= \ + --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 ) ) + -v --view -V --version -x --xterm -D --debuglevel -h \ + --help' -- $cur ) ) else _filedir -d fi |