2009-06-05 08:33:55 +02:00
|
|
|
# jar(1) completion
|
2009-10-01 20:54:51 +03:00
|
|
|
|
2009-06-05 08:33:55 +02:00
|
|
|
have jar &&
|
|
|
|
_jar()
|
|
|
|
{
|
2009-10-04 19:42:50 +02:00
|
|
|
local cur
|
2009-06-05 08:33:55 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=()
|
2010-02-08 17:25:08 +01:00
|
|
|
_get_comp_words_by_ref cur
|
2009-06-05 08:33:55 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
if [ $COMP_CWORD = 1 ]; then
|
|
|
|
COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
fi
|
2009-06-05 08:33:55 +02:00
|
|
|
|
2009-12-30 00:39:59 +01:00
|
|
|
case ${COMP_WORDS[1]} in
|
2009-10-04 19:42:50 +02:00
|
|
|
*c*f)
|
|
|
|
_filedir
|
|
|
|
;;
|
|
|
|
*f)
|
2010-09-19 12:29:29 +03:00
|
|
|
_filedir '@([ejw]ar|zip)'
|
2009-10-04 19:42:50 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_filedir
|
|
|
|
;;
|
|
|
|
esac
|
2009-06-05 08:33:55 +02:00
|
|
|
} &&
|
2009-10-22 12:04:29 +03:00
|
|
|
complete -F _jar -o filenames jar
|
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
|