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 01:00:40 UTC

[groovy] 01/02: 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 master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 676a2801eb3741c8da740eb3bf3c7428147bc6c4
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 11ae848b0e..f1c7e2a75b 100644
--- a/src/main/java/groovy/ui/GroovyMain.java
+++ b/src/main/java/groovy/ui/GroovyMain.java
@@ -206,7 +206,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 097b201304..69061e08b7 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 2e865cc52f..c106789cff 100644
--- a/src/spec/doc/tools-groovy.adoc
+++ b/src/spec/doc/tools-groovy.adoc
@@ -59,5 +59,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 e87bed6f30..240ecd1e7e 100644
--- a/src/spec/doc/tools-groovyc.adoc
+++ b/src/spec/doc/tools-groovyc.adoc
@@ -54,7 +54,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 f0ad9666f1..6f33b856e2 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 51966626a7..8bf058aada 100644
--- a/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
+++ b/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
@@ -66,7 +66,7 @@ The Groovy Swing Console allows a user to enter and run Groovy scripts.
   -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)
   -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 c4ddcae030..705213e198 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
@@ -90,6 +90,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 566087cff7..6e7e691209 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