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 2018/05/18 23:35:02 UTC

[1/4] groovy git commit: GROOVY-8588 use lowercase -v for --version in groovyc to be consistent with other Groovy command line tools (closes #710)

Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 1f380d2a5 -> c76b7cf2f


GROOVY-8588 use lowercase -v for --version in groovyc to be consistent with other Groovy command line tools (closes #710)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/3d1bd9e3
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/3d1bd9e3
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/3d1bd9e3

Branch: refs/heads/GROOVY_2_6_X
Commit: 3d1bd9e34c8b211574d2cd3537dade73ebd18a3d
Parents: 1f380d2
Author: Remko Popma <re...@yahoo.com>
Authored: Sat May 19 00:00:51 2018 +0900
Committer: Paul King <pa...@asert.com.au>
Committed: Sat May 19 09:07:31 2018 +1000

----------------------------------------------------------------------
 .../java/org/codehaus/groovy/tools/FileSystemCompiler.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3d1bd9e3/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
index e9fc8b5..545478c 100644
--- a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -166,7 +166,6 @@ public class FileSystemCompiler {
 
     public static CommandLine configureParser(CompilationOptions options) {
         CommandLine parser = new CommandLine(options);
-        parser.getCommandSpec().mixinStandardHelpOptions(true); // programmatically so these options appear last in usage help
         parser.getCommandSpec().parser()
                 .unmatchedArgumentsAllowed(true)
                 .unmatchedOptionsArePositionalParams(true)
@@ -350,6 +349,12 @@ public class FileSystemCompiler {
         @Option(names = {"--configscript"}, paramLabel = "<script>", description = "A script for tweaking the configuration options")
         private String configScript;
 
+        @Option(names = {"-h", "--help"}, usageHelp = true, description = "Show this help message and exit")
+        private boolean helpRequested;
+
+        @Option(names = {"-v", "--version"}, versionHelp = true, description = "Print version information and exit")
+        private boolean versionRequested;
+
         @Parameters(description = "The groovy source files to compile, or @-files containing a list of source files to compile",
                     paramLabel = "<source-files>")
         private List<String> files;


[2/4] groovy git commit: GROOVY-8589 bugfix: should not show error about missing mandatory args when --help or --version is specified

Posted by pa...@apache.org.
GROOVY-8589 bugfix: should not show error about missing mandatory args when --help or --version is specified


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/c02989a0
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/c02989a0
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/c02989a0

Branch: refs/heads/GROOVY_2_6_X
Commit: c02989a05e960a6d2bc3cad8f2ea754c53abfc0e
Parents: 3d1bd9e
Author: Remko Popma <re...@yahoo.com>
Authored: Sat May 19 00:21:58 2018 +0900
Committer: Paul King <pa...@asert.com.au>
Committed: Sat May 19 09:07:32 2018 +1000

----------------------------------------------------------------------
 src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/c02989a0/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy b/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
index eaa6964..7c6dee2 100644
--- a/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
+++ b/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
@@ -115,14 +115,14 @@ class GrapeMain implements Runnable {
             optionListHeading = "%nOptions:%n",
             descriptionHeading = "%n")
     private static class HelpOptionsMixin {
-        @Option(names = ["-h", "--help"], description = "usage information") boolean isHelpRequested
-        @Option(names = ["-v", "--version"], description = "display the Groovy and JVM versions") boolean isVersionRequested
+        @Option(names = ["-h", "--help"], usageHelp = true, description = "usage information") boolean isHelpRequested
+        @Option(names = ["-v", "--version"], versionHelp = true, description = "display the Groovy and JVM versions") boolean isVersionRequested
     }
 
     private static class VersionProvider implements CommandLine.IVersionProvider {
         String[] getVersion() {
             String version = GroovySystem.getVersion()
-            return "Groovy Version: $version JVM: ${System.getProperty('java.version')}"
+            return ["Groovy Version: $version JVM: ${System.getProperty('java.version')}"]
         }
     }
 


[4/4] groovy git commit: GROOVY-8569 minor tweak (align version short flag with previous Groovy versions)

Posted by pa...@apache.org.
GROOVY-8569 minor tweak (align version short flag with previous Groovy versions)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/c76b7cf2
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/c76b7cf2
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/c76b7cf2

Branch: refs/heads/GROOVY_2_6_X
Commit: c76b7cf2fafa0359c74a22caf9d919b6e403b07d
Parents: c4d6452
Author: Paul King <pa...@asert.com.au>
Authored: Sat May 19 09:33:23 2018 +1000
Committer: Paul King <pa...@asert.com.au>
Committed: Sat May 19 09:34:51 2018 +1000

----------------------------------------------------------------------
 src/main/groovy/groovy/ui/GroovyMain.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/c76b7cf2/src/main/groovy/groovy/ui/GroovyMain.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/groovy/ui/GroovyMain.java b/src/main/groovy/groovy/ui/GroovyMain.java
index eb2db46..58c6635 100644
--- a/src/main/groovy/groovy/ui/GroovyMain.java
+++ b/src/main/groovy/groovy/ui/GroovyMain.java
@@ -125,7 +125,6 @@ public class GroovyMain {
     static void processArgs(String[] args, final PrintStream out, final PrintStream err) {
         GroovyCommand groovyCommand = new GroovyCommand();
         CommandLine parser = new CommandLine(groovyCommand).setUnmatchedArgumentsAllowed(true).setStopAtUnmatched(true);
-        parser.getCommandSpec().mixinStandardHelpOptions(true);
         try {
             List<CommandLine> result = parser.parse(args);
             if (CommandLine.printHelpIfRequested(result, out, err, Help.Ansi.AUTO)) {
@@ -215,6 +214,12 @@ public class GroovyMain {
         @Option(names = {"-b", "--basescript"}, paramLabel = "<class>", description = "Base class name for scripts (must derive from Script)")
         private String scriptBaseClass;
 
+        @Option(names = {"-h", "--help"}, usageHelp = true, description = "Show this help message and exit")
+        private boolean helpRequested;
+
+        @Option(names = {"-v", "--version"}, versionHelp = true, description = "Print version information and exit")
+        private boolean versionRequested;
+
         @Unmatched
         List<String> arguments = new ArrayList<String>();
 


[3/4] groovy git commit: GROOVY-8577 upgrade to picocli 3.0.1: parent command name is now automatically inserted in usage help for subcommand (closes #711)

Posted by pa...@apache.org.
GROOVY-8577 upgrade to picocli 3.0.1: parent command name is now automatically inserted in usage help for subcommand (closes #711)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/c4d6452e
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/c4d6452e
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/c4d6452e

Branch: refs/heads/GROOVY_2_6_X
Commit: c4d6452eae8ede0e95180f8530f5251a48968a31
Parents: c02989a
Author: Remko Popma <re...@yahoo.com>
Authored: Sat May 19 00:37:39 2018 +0900
Committer: Paul King <pa...@asert.com.au>
Committed: Sat May 19 09:07:32 2018 +1000

----------------------------------------------------------------------
 build.gradle                                               | 2 +-
 src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/c4d6452e/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index edc53dd..aced033 100644
--- a/build.gradle
+++ b/build.gradle
@@ -162,7 +162,7 @@ ext {
     luceneVersion = '4.7.2'
     openbeansVersion = '1.0'
     openejbVersion = '1.0'
-    picocliVersion = '3.0.0'
+    picocliVersion = '3.0.1'
     qdoxVersion = '1.12.1'
     slf4jVersion = '1.7.21'
     xmlunitVersion = '1.6'

http://git-wip-us.apache.org/repos/asf/groovy/blob/c4d6452e/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy b/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
index 7c6dee2..b51322d 100644
--- a/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
+++ b/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy
@@ -127,7 +127,6 @@ class GrapeMain implements Runnable {
     }
 
     @Command(name = 'install', header = 'Installs a particular grape',
-            synopsisHeading = 'Usage: grape ',
             description = 'Installs the specified groovy module or maven artifact. If a version is specified that specific version will be installed, otherwise the most recent version will be used (as if `*` was passed in).')
     private static class Install implements Runnable {
         @Parameters(index = '0', arity = '1', description = 'Which module group the module comes from. Translates directly to a Maven groupId or an Ivy Organization. Any group matching /groovy[x][\\..*]^/ is reserved and may have special meaning to the groovy endorsed modules.')
@@ -164,7 +163,6 @@ class GrapeMain implements Runnable {
     }
 
     @Command(name = 'list', header = 'Lists all installed grapes',
-            synopsisHeading = 'Usage: grape ',
             description = 'Lists locally installed modules (with their full maven name in the case of groovy modules) and versions.')
     private static class ListCommand implements Runnable {
 
@@ -196,7 +194,6 @@ class GrapeMain implements Runnable {
     }
 
     @Command(name = 'resolve', header = 'Enumerates the jars used by a grape',
-            synopsisHeading = 'Usage: grape ',
             description = 'Prints the file locations of the jars representing the artifcats for the specified module(s) and the respective transitive dependencies.')
     private static class Resolve implements Runnable {
 
@@ -292,7 +289,6 @@ class GrapeMain implements Runnable {
     }
 
     @Command(name = 'uninstall',
-            synopsisHeading = 'Usage: grape ',
             description = 'Uninstalls a particular grape (non-transitively removes the respective jar file from the grape cache).')
     private static class Uninstall implements Runnable {
         @Parameters(index = '0', arity = '1', description = 'Which module group the module comes from. Translates directly to a Maven groupId or an Ivy Organization. Any group matching /groovy[x][\\..*]^/ is reserved and may have special meaning to the groovy endorsed modules.')