about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2002-08-24 19:19:14 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2002-08-24 19:19:14 +0000
commit043c302261dfee52e54e9a6c42b4ebcc2f7ccd33 (patch)
treedcd922959775f8c5701302c68e4425c285c14465 /Completion/Unix/Command
parentbc5567c859a074e2559b3c94c08ca1003b543da9 (diff)
downloadzsh-043c302261dfee52e54e9a6c42b4ebcc2f7ccd33.tar.gz
zsh-043c302261dfee52e54e9a6c42b4ebcc2f7ccd33.tar.xz
zsh-043c302261dfee52e54e9a6c42b4ebcc2f7ccd33.zip
17577: pass classpath as an option to _java_class pre-opt-arg
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_ant11
-rw-r--r--Completion/Unix/Command/_java15
-rw-r--r--Completion/Unix/Command/_zip8
3 files changed, 17 insertions, 17 deletions
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index 717fa9ea4..d33589bc3 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -2,8 +2,9 @@
 
 typeset -A opt_args
 local buildfile tmp state line curcontext="$curcontext"
-local target='*:target:->target'
-#local CLASSPATH="$ANT_HOME/lib/*.jar"
+local c target='*:target:->target'
+
+c=( $ANT_HOME/lib/*.jar )
 
 if [[ $service = *ANT_ARGS* ]]; then
   compset -q
@@ -22,12 +23,12 @@ _arguments -C \
   '-debug[print debugging information]' \
   '-emacs[produce logging information without adornments]' \
   '(-l -logfile)'{-l,-logfile}'[use specified file for log]:logfile:_files' \
-  '-logger[the class which is to perform logging]:classname:_java_class' \
-  '*-listener[add an instance of class as a project listener]:classname:_java_class' \
+  '-logger[the class which is to perform logging]:classname:_java_class -cp ${(j.:.)c}' \
+  '*-listener[add an instance of class as a project listener]:classname:_java_class -cp ${(j.:.)c}' \
   '(-f -file -buildfile -find)'{-f,-file,-buildfile}'[use specified build file]:build file:_files' \
   '*-D[specify property with value to use]:property:->property' \
   '-propertyfile[load properties from specfied file]:property file:_files' \
-  '-inputhandler[specify class which will handle input requests]:class:_java_class' \
+  '-inputhandler[specify class which will handle input requests]:class:_java_class -cp ${(j.\:.)c}' \
   '(-f -file -buildfile)-find[search for build file towards the root of filesystem]:build file:(build.xml)' \
   $target && return
 
diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java
index 48ccd4eaf..b2e204164 100644
--- a/Completion/Unix/Command/_java
+++ b/Completion/Unix/Command/_java
@@ -34,8 +34,7 @@ jdb)
 java)
   _arguments -C \
     "$jdb_args[@]" \
-    '(-cp)-classpath[specify path for user class files]:class path:->classpath' \
-    '(-classpath)-cp[specify path for user class files]:class path:->classpath' \
+    '(-cp -classpath)'{-cp,-classpath}'[specify path for user class files]:class path:->classpath' \
     '-D-[specify a property]:property:->property' \
     '(-verbose:class)-verbose[print class information]' \
     '(-verbose)-verbose\:class[print class information]' \
@@ -44,7 +43,7 @@ java)
     '-version[print version]' \
     '-help[print help message]' \
     '(- 1)-jar[specify a program capsulated as jar]:jar:_files -g \*.jar' \
-    '(-):class:_java_class -m main' \
+    '(-):class:_java_class -m main ${(kv)opt_args[(i)(-classpath|-cp)]}' \
     '*::args: _normal' \
      && return 0
   ;;
@@ -57,7 +56,7 @@ javadoc)
     '-package[display packages, public/protected classes and members only]' \
     '-private[display all classes and members]' \
     '-help[print help message]' \
-    '-doclet[specify a doclet]:doclet:_java_class -t doclet' \
+    '-doclet[specify a doclet]:doclet:_java_class -t doclet ${(kv)opt_args[(i)-classpath]}' \
     '-docletpath[specify a path to search doclet]:doclet path:->docletpath' \
     '-1.1[Javadoc 1.1 compatible output]' \
     '-sourcepath[specify path for source files]:source path:->sourcepath' \
@@ -118,7 +117,7 @@ jar)
     jar_cmd="${words[2]#-}"
     tmpassoc=(
       m ':manifest file:_files'
-      f ':archive file:_files -g \*.\(jar\|zip\)'
+      f ':archive file:_files -g \*.\([ejw]ar\|zip\)'
     )
     _arguments -C \
       "${jar_cmd/[^-]*/:dummy:}" \
@@ -140,7 +139,7 @@ javah|javah_g)
     '-bootclasspath[specify path for bootstrap class files]:bootstrap class path:->bootstrapclasspath' \
     '-old[generate old JDK1.0-style header files]' \
     '-force[force output]' \
-    '*:fully qualified classname:_java_class -m main' && return 0
+    '*:fully qualified classname:_java_class -m main ${(kv)opt_args[(i)-classpath]}' && return 0
   ;;
 
 javap)
@@ -159,7 +158,7 @@ javap)
     '-classpath[specify path for user class files]:class path:->classpath' \
     '-bootclasspath[specify path for bootstrap class files]:bootstrap class path:->bootstrapclasspath' \
     '-extdirs[specify directories for extensions]:extensions directories:->extdirs' \
-    '*:class:_java_class' && return 0
+    '*:class:_java_class ${(kv)opt_args[(i)-classpath]}' && return 0
   ;;
 
 extcheck)
@@ -182,7 +181,7 @@ rmic)
     '-verbose[print verbose messages]' \
     '-v1.1[JDK 1.1 stub protocol]' \
     '-v1.2[JDK 1.2 stub protocol]' \
-    '*:package qualified class name:_java_class' && return 0
+    '*:package qualified class name:_java_class  ${(kv)opt_args[(i)-classpath]}' && return 0
   ;;
 
 rmiregistry)
diff --git a/Completion/Unix/Command/_zip b/Completion/Unix/Command/_zip
index 6f83b748f..29c4f85d4 100644
--- a/Completion/Unix/Command/_zip
+++ b/Completion/Unix/Command/_zip
@@ -50,7 +50,7 @@ case $service in
       '(-0 -1 -2 -3 -4 -5 -6 -7 -8   )-9[compress better]' \
       '-x[exclude the following names]' \
       '-i[include only the following names]' \
-      "(-f -d -R -q -c -b -@ -F -FF -A -T -y -e -h -u -m -g -j -l -ll -L -v -z -t -tt -o -D -J -X -n -0 -1 -2 -3 -4 -5 -6 -7 -8 -9):zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
+      "(-f -d -R -q -c -b -@ -F -FF -A -T -y -e -h -u -m -g -j -l -ll -L -v -z -t -tt -o -D -J -X -n -0 -1 -2 -3 -4 -5 -6 -7 -8 -9):zip file:_files -g '(#i)*.(zip|[ejw]ar)'" \
       '*:file:->files' && return 0
   ;;
   unzip)
@@ -75,7 +75,7 @@ case $service in
       '-M[page output]' \
       '-x[exclude the following names]' \
       '-Z[zipinfo mode]:zipinfomode:->zipinfo' \
-      "(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
+      "(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|[ejw]ar)'" \
       '*:file:->files' && return 0
   ;;
 esac
@@ -98,7 +98,7 @@ if [[ $service == zipinfo ]] || [[ -n $uzi ]]; then
       '(-1 -2)-T[use sortable decimal format for file times]' \
       '-M[page output]' \
       '-x[exclude the following names]' \
-      "(-1 -2 -s -m -l -v -h -z -C -t -T -M)1:zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
+      "(-1 -2 -s -m -l -v -h -z -C -t -T -M)1:zip file:_files -g '(#i)*.(zip|[ejw]ar)'" \
       '*:file:->files' && return 0
 fi
 
@@ -112,7 +112,7 @@ case $state in
   ;;
   files)
     if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then
-      _files -g '^(#i)*.(zip|[jw]ar)' && return 0
+      _files -g '^(#i)*.(zip|[ejw]ar)' && return 0
     else
       zipfile=( $~line[1](|.zip|.ZIP) )
       [[ -z $zipfile[1] ]] && return 1