[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-42-ga73774c

Ville Skyttä ville.skytta at iki.fi
Thu Mar 24 18:47:12 UTC 2011


The following commit has been merged in the master branch:
commit 920b1f93b64b4e95b7097085290ea6f998d8347f
Author: Mattias Ulbrich <ulbrich at kit.edu>
Date:   Thu Mar 24 18:16:28 2011 +0100

    improved java completion
    
    now suggests also package names

diff --git a/CHANGES b/CHANGES
index 679fae3..a9cc476 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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 at gmail.com>  Sun, 06 Feb 2011 21:46:37 +0100
 
 bash-completion (1.3)
diff --git a/completions/java b/completions/java
index 460ae28..4e0ae9c 100644
--- a/completions/java
+++ b/completions/java
@@ -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

-- 
bash-completion



More information about the Bash-completion-commits mailing list