improved java completion

now suggests also package names
This commit is contained in:
Mattias Ulbrich 2011-03-24 18:16:28 +01:00 committed by Ville Skyttä
parent 8227e76e09
commit 920b1f93b6
2 changed files with 7 additions and 4 deletions

View File

@ -18,6 +18,9 @@ bash-completion (2.x)
* Improve __reassemble_comp_words_by_ref() to not create words of
characters-to-exclude (Alioth: #313057)
[ Mattias Ulbrich ]
* Make java class completion suggest packages.
-- David Paleino <d.paleino@gmail.com> Sun, 06 Feb 2011 21:46:37 +0100
bash-completion (1.3)

View File

@ -72,11 +72,11 @@ _java_classes()
fi
elif [ -d $i ]; then
# Intentionally looking for *.class only in $i (not subdirs),
# see Debian bug #496828.
compopt -o nospace
COMPREPLY=( "${COMPREPLY[@]}"
$( command ls $i/$cur*.class 2>/dev/null | \
sed -ne '/\$/d' -e "s|^$i//*||p" ) )
$( compgen -d -- $i/$cur | sed -e "s|^$i/\(.*\)|\1.|" )
$( compgen -f -X '!*.class' -- $i/$cur | sed -e "s|^$i/||" )
)
# FIXME: if we have foo.class and foo/, the completion
# returns "foo/"... how to give precedence to files