You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/05/15 02:57:57 UTC
[groovy] branch GROOVY_3_0_X updated: GROOVY-10626: --enable-preview doesn't show in CLI/help for groovysh
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
new 7346cb8987 GROOVY-10626: --enable-preview doesn't show in CLI/help for groovysh
7346cb8987 is described below
commit 7346cb89878437bdda202f8350c8a676881c808c
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun May 15 10:59:14 2022 +1000
GROOVY-10626: --enable-preview doesn't show in CLI/help for groovysh
---
src/main/java/groovy/ui/GroovyMain.java | 2 +-
src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java | 2 +-
src/spec/doc/tools-groovy.adoc | 2 +-
src/spec/doc/tools-groovyc.adoc | 2 +-
.../src/main/resources/groovy/console/ui/Console.properties | 2 +-
subprojects/groovy-console/src/spec/doc/groovy-console.adoc | 2 +-
.../src/main/groovy/org/apache/groovy/groovysh/Main.groovy | 1 +
.../src/main/resources/org/apache/groovy/groovysh/Main.properties | 2 ++
subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc | 2 +-
9 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/main/java/groovy/ui/GroovyMain.java b/src/main/java/groovy/ui/GroovyMain.java
index c98f33e30b..8771a7d3bb 100644
--- a/src/main/java/groovy/ui/GroovyMain.java
+++ b/src/main/java/groovy/ui/GroovyMain.java
@@ -207,7 +207,7 @@ public class GroovyMain {
@Option(names = {"-pa", "--parameters"}, description = "Generate metadata for reflection on method parameter names (jdk8+ only)")
private boolean parameterMetadata;
- @Option(names = {"-pr", "--enable-preview"}, description = "Enable preview Java features (JEP 12) (jdk12+ only)")
+ @Option(names = {"-pr", "--enable-preview"}, description = "Enable preview Java features (jdk12+ only)")
private boolean previewFeatures;
@Option(names = "-l", arity = "0..1", paramLabel = "<port>", description = "Listen on a port and process inbound lines (default: 1960)")
diff --git a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
index 900770dae6..225a89aeb4 100644
--- a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -363,7 +363,7 @@ public class FileSystemCompiler {
@Option(names = {"-pa", "--parameters"}, description = "Generate metadata for reflection on method parameter names (jdk8+ only)")
private boolean parameterMetadata;
- @Option(names = {"-pr", "--enable-preview"}, description = "Enable preview Java features (JEP 12) (jdk12+ only) - must be after classpath but before other arguments")
+ @Option(names = {"-pr", "--enable-preview"}, description = "Enable preview Java features (jdk12+ only) - must be after classpath but before other arguments")
private boolean previewFeatures;
@Option(names = {"-j", "--jointCompilation"}, description = "Attach javac compiler to compile .java files")
diff --git a/src/spec/doc/tools-groovy.adoc b/src/spec/doc/tools-groovy.adoc
index caf202c1a7..33f02bf611 100644
--- a/src/spec/doc/tools-groovy.adoc
+++ b/src/spec/doc/tools-groovy.adoc
@@ -60,5 +60,5 @@ int (disable any int based optimizations) |
| -p | | process files line by line and print result (see also -n) |
| -v | --version | display the Groovy and JVM versions | groovy -v
| -pa | --parameters | Generates metadata for reflection on method parameter names on JDK 8 and above. Defaults to false. | groovy --parameters Person.groovy
-| -pr | --enable-preview | Enable preview Java features (JEP 12) (jdk12+ only). | groovy --enable-preview Person.groovy
+| -pr | --enable-preview | Enable preview Java features (jdk12+ only). | groovy --enable-preview Person.groovy
|=======================================================================
diff --git a/src/spec/doc/tools-groovyc.adoc b/src/spec/doc/tools-groovyc.adoc
index 6aadad1f41..c9eb3b38f5 100644
--- a/src/spec/doc/tools-groovyc.adoc
+++ b/src/spec/doc/tools-groovyc.adoc
@@ -52,7 +52,7 @@ a number of command line switches:
| -Jproperty=value | | Properties to be passed to `javac` if joint compilation is enabled | groovyc -j -Jtarget=1.6 -Jsource=1.6 A.groovy B.java
| -Fflag | | Flags to be passed to `javac` if joint compilation is enabled | groovyc -j -Fnowarn A.groovy B.java
| -pa | --parameters | Generates metadata for reflection on method parameter names. Requires Java 8+. | groovyc --parameters Person.groovy
-| -pr | --enable-preview | Enable preview Java features (JEP 12) (jdk12+ only). | groovy --enable-preview Person.groovy
+| -pr | --enable-preview | Enable preview Java features (jdk12+ only). | groovy --enable-preview Person.groovy
| @argfile | | Read options and source files from specified file. | groovyc @conf/args
|=======================================================================
diff --git a/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties b/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
index 56371c2510..b396b64706 100644
--- a/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
+++ b/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
@@ -26,7 +26,7 @@ cli.option.cp.description=Aliases for '-classpath'
cli.option.classpath.description=Specify where to find the class files - must be first argument
-cli.option.enable.preview.description=Enable preview Java features (JEP 12) (jdk12+ only) - must be after classpath but before other arguments
+cli.option.enable.preview.description=Enable preview Java features (jdk12+ only) - must be after classpath but before other arguments
cli.option.parameters.description=Generate metadata for reflection on method parameter names (jdk8+ only)
diff --git a/subprojects/groovy-console/src/spec/doc/groovy-console.adoc b/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
index 456b1e9379..e910d8f4b9 100644
--- a/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
+++ b/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
@@ -64,7 +64,7 @@ The Groovy Swing Console allows a user to enter and run Groovy scripts.
-i, --indy Enable InvokeDynamic (Indy) compilation for scripts
-pa, --parameters Generate metadata for reflection on method parameter
names (jdk8+ only)
- -pr, --enable-preview Enable preview Java features (JEP 12) (jdk12+ only)
+ -pr, --enable-preview Enable preview Java features (jdk12+ only)
-V, --version Display the version
-----------------------------------------------------------------
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Main.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Main.groovy
index a36ffce6d1..9cdcbeb8ef 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Main.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Main.groovy
@@ -86,6 +86,7 @@ class Main {
D(longOpt: 'define', type: Map, argName: 'name=value', messages['cli.option.define.description'])
T(longOpt: 'terminal', args: 1, argName: 'TYPE', messages['cli.option.terminal.description'])
pa(longOpt: 'parameters', messages['cli.option.parameters.description'])
+ pr(longOpt: 'enable-preview', messages['cli.option.enable.preview.description'])
}
OptionAccessor options = cli.parse(args)
diff --git a/subprojects/groovy-groovysh/src/main/resources/org/apache/groovy/groovysh/Main.properties b/subprojects/groovy-groovysh/src/main/resources/org/apache/groovy/groovysh/Main.properties
index fac864ddbe..94d294f3b1 100644
--- a/subprojects/groovy-groovysh/src/main/resources/org/apache/groovy/groovysh/Main.properties
+++ b/subprojects/groovy-groovysh/src/main/resources/org/apache/groovy/groovysh/Main.properties
@@ -46,4 +46,6 @@ cli.option.terminal.description=Specify the terminal TYPE to use
cli.option.parameters.description=Generate metadata for reflection on method parameter names (jdk8+ only)
+cli.option.enable.preview.description=Enable preview Java features (jdk12+ only) - must be after classpath but before other arguments
+
cli.info.version=@|green Groovy Shell|@ {0}
diff --git a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
index da704fd7bd..90dab80453 100644
--- a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
+++ b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
@@ -63,7 +63,7 @@ experiments.
-h, --help Display this help message
-pa, --parameters Generate metadata for reflection on method parameter names
(jdk8+ only)
- -pr, --enable-preview Enable preview Java features (JEP 12) (jdk12+ only)
+ -pr, --enable-preview Enable preview Java features (jdk12+ only)
-q, --quiet Suppress superfluous output
-T, --terminal=<TYPE> Specify the terminal TYPE to use
-v, --verbose Enable verbose output