make selection of optionsvs mandatory argument completion similar to others

This commit is contained in:
Guillaume Rousse 2009-12-30 00:31:17 +01:00
parent 2e1b780d84
commit 877d36fefb
3 changed files with 13 additions and 29 deletions

View File

@ -8,22 +8,16 @@ _unace()
COMPREPLY=()
cur=`_get_cword`
case "$cur" in
-*)
COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' \
-- "$cur" ) )
;;
*)
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- "$cur" ) )
else
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'e l t v x' -- "$cur" ) )
else
_filedir '@(ace|ACE)'
fi
;;
esac
return 0
fi
} &&
complete -F _unace -o filenames unace

View File

@ -8,22 +8,18 @@ _unrar()
COMPREPLY=()
cur=`_get_cword`
case "$cur" in
-*)
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu \
-dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta \
-tb -tn -to -u -v -ver -vp -x -x@ -y' -- "$cur" ) )
;;
*)
else
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) )
else
_filedir '@(rar|RAR)'
fi
;;
esac
fi
return 0
} &&
complete -F _unrar -o filenames unrar

View File

@ -7,17 +7,11 @@ _yum_arch()
COMPREPLY=()
cur=`_get_cword`
case "$cur" in
-*)
COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l \
-q' -- "$cur" ) )
;;
*)
_filedir -d
;;
esac
return 0
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur" ) )
else
_filedir -d
fi
} &&
complete -F _yum_arch -o filenames yum-arch