33 lines
709 B
Plaintext
Raw Normal View History

# unrar(1) completion
2009-06-08 21:22:43 +03:00
have unrar &&
_unrar()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]] ; then
2009-10-04 19:42:50 +02:00
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
2009-10-04 19:42:50 +02:00
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) )
else
_filedir rar
2009-10-04 19:42:50 +02:00
fi
fi
2009-06-08 21:22:43 +03:00
} &&
complete -F _unrar unrar
# Local variables:
# mode: shell-script
2009-10-04 19:42:50 +02:00
# sh-basic-offset: 4
# sh-indent-comment: t
2009-10-04 19:42:50 +02:00
# indent-tabs-mode: nil
# End:
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh