diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-02-06 14:53:55 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-02-06 14:53:55 +0200 |
commit | 1b0e17c2a3a4831ba52435c360b34b5e1dca10c4 (patch) | |
tree | d1ccc0eab59602f3025cab0f65b2c0718b95e02a | |
parent | ca9405710e424527b73f41961eebc934f3e93247 (diff) | |
download | bash-completion-1b0e17c2a3a4831ba52435c360b34b5e1dca10c4.tar.gz |
Define needed utility functions for javac and javadoc even if java is not installed.
-rw-r--r-- | completions/java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/completions/java b/completions/java index b8bbb79e..999e6bfc 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() |