2009-12-30 00:00:07 +01:00
|
|
|
# unrar(1) completion
|
2003-01-21 06:42:46 +00:00
|
|
|
|
2011-04-05 00:35:51 +03:00
|
|
|
have unrar || return
|
|
|
|
|
2009-07-25 13:38:42 +03:00
|
|
|
_unrar()
|
2003-01-21 06:42:46 +00:00
|
|
|
{
|
2011-04-21 11:04:51 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2003-01-21 06:42:46 +00:00
|
|
|
|
2009-12-30 00:31:17 +01:00
|
|
|
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" ) )
|
2009-12-30 00:31:17 +01:00
|
|
|
else
|
2011-04-21 11:04:51 +03:00
|
|
|
if [ $cword -eq 1 ]; then
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) )
|
|
|
|
else
|
2010-09-19 12:29:29 +03:00
|
|
|
_filedir rar
|
2009-10-04 19:42:50 +02:00
|
|
|
fi
|
2009-12-30 00:31:17 +01:00
|
|
|
fi
|
2009-07-25 13:38:42 +03:00
|
|
|
|
2009-06-08 21:22:43 +03:00
|
|
|
} &&
|
2010-11-01 19:26:53 +02:00
|
|
|
complete -F _unrar unrar
|
2009-10-01 20:54:51 +03:00
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
2009-10-04 19:42:50 +02:00
|
|
|
# sh-basic-offset: 4
|
2009-10-01 20:54:51 +03:00
|
|
|
# sh-indent-comment: t
|
2009-10-04 19:42:50 +02:00
|
|
|
# indent-tabs-mode: nil
|
2009-10-01 20:54:51 +03:00
|
|
|
# End:
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|