37 lines
702 B
Plaintext
Raw Normal View History

# unrar(1) completion by Guillaume Rousse <rousse@ccr.jussieu.fr>
2009-06-08 21:22:43 +03:00
have unrar &&
_unrar()
{
local cur
COMPREPLY=()
cur=`_get_cword`
case "$cur" in
-*)
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" ) )
;;
*)
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
return 0
2009-06-08 21:22:43 +03:00
} &&
2009-02-05 10:11:24 +01:00
complete -F _unrar $filenames unrar
# Local variables:
# mode: shell-script
# sh-basic-offset: 8
# sh-indent-comment: t
# indent-tabs-mode: t
# End:
# ex: ts=8 sw=8 noet filetype=sh