Split jar completion to contrib/jar

This commit is contained in:
David Paleino 2009-06-05 08:33:55 +02:00
parent f844abd042
commit 7dbb6a2e3d
4 changed files with 30 additions and 29 deletions

View File

@ -19,6 +19,7 @@ bash-completion (1.x)
* Split {update,invoke}-rc.d completions to contrib/sysv-rc
* Don't install _subversion anymore
* Split autorpm completion to contrib/autorpm
* Split jar completion to contrib/jar
[ Ville Skyttä ]
* Split yum and yum-arch completion into contrib/yum.

View File

@ -41,6 +41,7 @@ bashcomp_DATA = contrib/ant \
contrib/info \
contrib/iptables \
contrib/isql \
contrib/jar \
contrib/java \
contrib/larch \
contrib/ldapvi \

View File

@ -2391,35 +2391,6 @@ _route()
}
[ $UNAME = Linux ] && complete -F _route route
# jar(1) completion
#
have jar &&
_jar()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=( $( compgen -W 'c t x u' -- $cur ) )
return 0
fi
case "${COMP_WORDS[1]}" in
*c*f)
_filedir
;;
*f)
_filedir '?([ejw]ar|zip|[EJW]AR|ZIP)'
;;
*)
_filedir
;;
esac
} &&
complete -F _jar $filenames jar
# This meta-cd function observes the CDPATH variable, so that cd additionally
# completes on directories under those specified in CDPATH.
#

28
contrib/jar Normal file
View File

@ -0,0 +1,28 @@
# jar(1) completion
#
have jar &&
_jar()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=( $( compgen -W 'c t x u' -- $cur ) )
return 0
fi
case "${COMP_WORDS[1]}" in
*c*f)
_filedir
;;
*f)
_filedir '?([ejw]ar|zip|[EJW]AR|ZIP)'
;;
*)
_filedir
;;
esac
} &&
complete -F _jar $filenames jar