[Bash-completion-commits] [SCM] bash-completion branch, master, updated. cb01d8ea5434c2c9f4826b35f5f687d7723102e8

Ville Skyttä ville.skytta at iki.fi
Sun Feb 6 13:15:29 UTC 2011


The following commit has been merged in the master branch:
commit 1b0e17c2a3a4831ba52435c360b34b5e1dca10c4
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Feb 6 14:53:55 2011 +0200

    Define needed utility functions for javac and javadoc even if java is not installed.

diff --git a/completions/java b/completions/java
index b8bbb79..999e6bf 100644
--- a/completions/java
+++ b/completions/java
@@ -1,13 +1,14 @@
 # bash completion for java, javac and javadoc
 
 # available path elements completion
-have java && {
+have java || have javac || have javadoc &&
 _java_path()
 {
     cur=${cur##*:}
     _filedir '@(jar|zip)'
 }
 
+have java || have javadoc && {
 # exact classpath determination
 _java_find_classpath()
 {
@@ -113,9 +114,11 @@ _java_packages()
     # convert path syntax to package syntax
     cur=${COMPREPLY[@]//\//.}
 }
+}
 
 # java completion
 #
+have java &&
 _java()
 {
     local cur prev words cword i
@@ -230,9 +233,8 @@ _java()
         type compopt &>/dev/null && compopt -o nospace
 
     __ltrim_colon_completions "$cur"
-}
+} &&
 complete -F _java java
-}
 
 have javadoc &&
 _javadoc()

-- 
bash-completion



More information about the Bash-completion-commits mailing list