[PATCH] repaired sourcepath and classpath lookup
Mattias Ulbrich
ulbrich at kit.edu
Wed Apr 6 12:12:37 UTC 2011
did not work correctly if multiple paths were given (using :)
now takes the corrected information
---
completions/java | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/completions/java b/completions/java
index 73a8890..a98d8db 100644
--- a/completions/java
+++ b/completions/java
@@ -15,9 +15,9 @@ _java_find_classpath()
local i
# search first in current options
- for (( i=1; i < COMP_CWORD; i++ )); do
- if [[ "${COMP_WORDS[i]}" == -@(cp|classpath) ]]; then
- classpath=${COMP_WORDS[i+1]}
+ for (( i=1; i < cword; i++ )); do
+ if [[ "${words[i]}" == -@(cp|classpath) ]]; then
+ classpath=${words[i+1]}
break
fi
done
@@ -35,9 +35,9 @@ _java_find_sourcepath()
local i
# search first in current options
- for (( i=1; i < COMP_CWORD; i++ )); do
- if [[ "${COMP_WORDS[i]}" == -sourcepath ]]; then
- sourcepath=${COMP_WORDS[i+1]}
+ for (( i=1; i < cword; i++ )); do
+ if [[ "${words[i]}" == -sourcepath ]]; then
+ sourcepath=${words[i+1]}
break
fi
done
--
1.7.0.4
--=-1jJjSqpXJ5ib1sS0UFly--
More information about the Bash-completion-devel
mailing list