From bf098bc29e1bfe8082a3d2e02ea56924e2f6ea80 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 23 Jun 2015 03:24:49 +0200 Subject: 35529: fix filename completion after java -jar --- Completion/Unix/Command/_java | 66 +++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 18 deletions(-) (limited to 'Completion/Unix') diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java index 7b1dce18f..2aef15a25 100644 --- a/Completion/Unix/Command/_java +++ b/Completion/Unix/Command/_java @@ -7,45 +7,76 @@ typeset -A opt_args tmpassoc jdb_args=() case "$service" in +javac|jar) + if compset -P @; then + _wanted files expl 'option file' _files + return + fi + ;| # continue javac) _arguments -C \ '-g-[generate debugging information]:debug:->debug' \ + '-A-[specify option to annotation processors]:option' \ + '-implicit\:-[control generation of class files for implicitly loaded sources]:implicit:(class none)' \ '-nowarn[generate no warnings]' \ '-verbose[output messages about what the compiler is doing]' \ '-deprecation[output source locations where deprecated APIs are used]' \ - '-classpath[specify where to find user class files]:class path:->classpath' \ + '(-cp -classpath)'{-cp,-classpath}'[specify where to find user class files]:class path:->classpath' \ '-sourcepath[specify where to find input source files]:source path:->sourcepath' \ '-bootclasspath[override location of bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ '-extdirs[override location of installed extensions]:extensions directories:->extdirs' \ '-d[specify where to place generated class files]:directory:_files -/' \ '-encoding[specify character encoding used by source files]:encoding:->encoding' \ - '-source[provide source compatibility with specified release]:release:(1.{2..5})' \ + '-proc\:-[control annotation processing]:annotation processing:(none only)' \ + '-processor[specify annotation processors to run]:class:_files' \ + '-processorpath[specify where to find annotation processors]:directory:_directories' \ + '-s[specify directory for generated source files]:directory:_directories' \ + '-source[provide source compatibility with specified release]:release:(1.{2..8} {5..8})' \ '-target[specify VM version]:release:(1.{1..5})' \ - '-help[print a synopsis of standard options]' \ + '(-)-help[print a synopsis of standard options]' \ + '(-)-version[print version information]' \ + '(-)-X[display information about non-standard options]' \ '*:java source file:_files -g \*.java\(-.\)' && return 0 ;; jdb) jdb_args=( '-host[specify host to connect to]:host:_hosts' - '-password[specify password]:password:' + '-password[specify password]:password' + '-attach[attach to running VM]:address' + '-listen[wait for VM to connect]:address' + '-listenany[wait for VM to connect at any available address]' + '-launch[launch VM immediately]' + '-listconnectors[list the connectors available in this VM]' + '-connect[connect to target VM]:connector' + -dbgtrace -tclient -tserver + '-J-[java runtime option]:option' ) ;& java) _arguments -C \ "$jdb_args[@]" \ + -client -server -d32 -d64 \ + '-agentlib\:-:agent library' \ + '-agentpath\:-:path:_directories' \ + '-javaagent\:-:path:_directories' \ '(-cp -classpath)'{-cp,-classpath}'[specify path for user class files]:class path:->classpath' \ '-D-[specify a property]:property:->property' \ + \*{-enableassertions,-ea}-::class \ + \*{-disableassertions,-da}-::class \ + '(-enablesystemassertions,-esa,-disablesystemassertions,-dsa)'{-enablesystemassertions,-esa,-disablesystemassertions,-dsa} \ '(-verbose:class)-verbose[print class information]' \ '(-verbose)-verbose\:class[print class information]' \ '-verbose\:gc[print gc information]' \ '-verbose\:jni[print JNI information]' \ - '-version[print version]' \ - '-help[print help message]' \