groovy git commit: trivial refactor: support -h for java2groovy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: trivial refactor: support -h for java2groovy

paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X b5f66232f -> 6035708b0


trivial refactor: support -h for java2groovy


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 6035708b047d5dcbd23829c9824fc92841d8244c
Parents: b5f6623
Author: Paul King <[hidden email]>
Authored: Sat May 26 21:13:34 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Sat May 26 21:13:34 2018 +1000

----------------------------------------------------------------------
 .../java/org/codehaus/groovy/antlr/java/Java2GroovyMain.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/6035708b/src/main/java/org/codehaus/groovy/antlr/java/Java2GroovyMain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/antlr/java/Java2GroovyMain.java b/src/main/java/org/codehaus/groovy/antlr/java/Java2GroovyMain.java
index 3cd02a7..abb82e5 100644
--- a/src/main/java/org/codehaus/groovy/antlr/java/Java2GroovyMain.java
+++ b/src/main/java/org/codehaus/groovy/antlr/java/Java2GroovyMain.java
@@ -24,10 +24,11 @@ public class Java2GroovyMain {
 
     public static void main(String[] args) {
         try {
-            if (args.length == 0) {
-                System.err.println("Needs at least one filename");
+            if (args.length == 0 || (args.length == 1 && args[0].equals("-h"))) {
+                System.err.println("Usage: java2groovy <one or more filenames>");
+            } else {
+                Java2GroovyProcessor.processFiles(Arrays.asList(args));
             }
-            Java2GroovyProcessor.processFiles(Arrays.asList(args));
         } catch (Throwable t) {
             t.printStackTrace();
         }