about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2024-02-22 19:07:01 +0100
committerOliver Kiddle <opk@zsh.org>2024-02-22 19:07:01 +0100
commit40d5200c8b882708ecd411bd88760e20deec82fd (patch)
treedc7afcf5da1734e2439a633f9e4c83ed032cb83a
parent6b21e5c0e201876f6659b563b56da9a993ae6c03 (diff)
downloadzsh-40d5200c8b882708ecd411bd88760e20deec82fd.tar.gz
zsh-40d5200c8b882708ecd411bd88760e20deec82fd.tar.xz
zsh-40d5200c8b882708ecd411bd88760e20deec82fd.zip
52552: newer Java supports passing source files directly to java
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_java5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 090644e8b..91503f01d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-22  Oliver Kiddle  <opk@zsh.org>
+
+	* 52552: Completion/Unix/Command/_java: newer Java supports
+	passing source files directly to java
+
 2024-02-20  Bart Schaefer  <schaefer@zsh.org>
 
 	* 52559: Doc/Zsh/builtins.yo, Doc/Zsh/mod_private.yo,
diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java
index b2352df7b..325413d87 100644
--- a/Completion/Unix/Command/_java
+++ b/Completion/Unix/Command/_java
@@ -82,7 +82,10 @@ java)
     '(- 1)-X-[non-standard java option]:option' \
     '(- 1)-jar[specify a program encapsulated as jar]:jar:_files -g \*.jar\(-.\)' \
     '-splash\:-[show splash screen with specified image]:image:_files' \
-    '(-):class:_java_class -m main ${(kv)opt_args[(i)(-classpath|-cp)]}' \
+    '--source=[set the version of the source in source-file mode]:version' \
+    '(-):arg: _alternative
+      "classes\:class\:{ (( ! $+opt_args[--source] )) && _java_class -m main ${(kv)opt_args[(i)(-classpath|-cp)]} }"
+      "files\:source file\:_files -g \*.java\(-.\)"' \
     '*::args:= _normal' \
      && return 0
   ;;