28 lines
526 B
Plaintext
Raw Normal View History

# jar(1) completion -*- shell-script -*-
2009-06-05 08:33:55 +02:00
_jar()
{
local cur prev words cword
_init_completion || return
2009-06-05 08:33:55 +02:00
if [[ $cword -eq 1 ]]; then
2009-10-04 19:42:50 +02:00
COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) )
return 0
fi
2009-06-05 08:33:55 +02:00
case ${words[1]} in
2009-10-04 19:42:50 +02:00
*c*f)
_filedir
;;
*f)
_filedir '@([ejsw]ar|zip|apk)'
2009-10-04 19:42:50 +02:00
;;
*)
_filedir
;;
esac
2009-06-05 08:33:55 +02:00
} &&
complete -F _jar jar
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh