[1/3] groovy git commit: GROOVY-8718: handle new quit handler param better

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/3] groovy git commit: GROOVY-8718: handle new quit handler param better

paulk
Repository: groovy
Updated Branches:
  refs/heads/master d56d9e756 -> 93af30530


GROOVY-8718: handle new quit handler param better


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

Branch: refs/heads/master
Commit: 85912669aad2f758977ef78a4dc78e847453b557
Parents: d56d9e7
Author: Paul King <[hidden email]>
Authored: Fri Aug 10 14:57:17 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Fri Aug 10 14:57:17 2018 +1000

----------------------------------------------------------------------
 .../groovy-console/src/main/groovy/groovy/ui/Console.groovy   | 7 ++++++-
 .../src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy       | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/85912669/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
index 8a1708d..a0c7009 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
@@ -679,7 +679,12 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
         runThread?.interrupt()
     }
 
-    void exit(EventObject evt = null, desktopQuitResponse = null) {
+    void exitDesktop(EventObject evt = null, quitResponse = null) {
+        exit(evt)
+        quitResponse.performQuit()
+    }
+
+    void exit(EventObject evt = null) {
         if (askToInterruptScript()) {
             if (askToSaveFile()) {
                 if (frame instanceof Window) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/85912669/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
index 8b25190..b40e26d 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
@@ -30,7 +30,7 @@ if (!handler) {
 import java.awt.Desktop
 def handler = Desktop.getDesktop()
 handler.setAboutHandler(controller.&showAbout)
-handler.setQuitHandler(controller.&exit)
+handler.setQuitHandler(controller.&exitDesktop)
 handler.setPreferencesHandler(controller.&preferences)
 handler
 """ : """

Reply | Threaded
Open this post in threaded view
|

[2/3] groovy git commit: GROOVY-8740: groovy.util.CliBuilder doesn't handle parse errors correctly

paulk
GROOVY-8740: groovy.util.CliBuilder doesn't handle parse errors correctly


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

Branch: refs/heads/master
Commit: 044c3c43de61a1eab3d1054fdf7f4a85ea789eb2
Parents: 8591266
Author: Paul King <[hidden email]>
Authored: Fri Aug 10 21:27:37 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Fri Aug 10 22:09:37 2018 +1000

----------------------------------------------------------------------
 .../src/main/groovy/groovy/util/CliBuilder.groovy                | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/044c3c43/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy b/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
index 58ec973..4d729a7 100644
--- a/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
+++ b/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
@@ -18,6 +18,7 @@
  */
 package groovy.util
 
+import groovy.cli.commons.OptionAccessor
 import org.apache.commons.cli.CommandLineParser
 import org.apache.commons.cli.HelpFormatter
 
@@ -31,7 +32,8 @@ class CliBuilder {
 
     // explicit delegate to convert return type to expected legacy package
     OptionAccessor parse(args) {
-        return new OptionAccessor(delegate: delegate.parse(args))
+        def result = delegate.parse(args)
+        return result == null ? null : new OptionAccessor(delegate: result)
     }
 
     // explicit delegate since groovyObject methods ignored by @Delegate

Reply | Threaded
Open this post in threaded view
|

[3/3] groovy git commit: GROOVY-8740: groovy.util.CliBuilder doesn't handle parse errors correctly

paulk
In reply to this post by paulk
GROOVY-8740: groovy.util.CliBuilder doesn't handle parse errors correctly


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

Branch: refs/heads/master
Commit: 93af305304a788fb5c42c042d2e8fc523ddbdc19
Parents: 044c3c4
Author: Paul King <[hidden email]>
Authored: Fri Aug 10 21:37:22 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Fri Aug 10 22:09:37 2018 +1000

----------------------------------------------------------------------
 .../src/main/groovy/groovy/util/CliBuilder.groovy                   | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/93af3053/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy b/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
index 4d729a7..c50fca2 100644
--- a/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
+++ b/subprojects/groovy-cli-commons/src/main/groovy/groovy/util/CliBuilder.groovy
@@ -18,7 +18,6 @@
  */
 package groovy.util
 
-import groovy.cli.commons.OptionAccessor
 import org.apache.commons.cli.CommandLineParser
 import org.apache.commons.cli.HelpFormatter