geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r428595 - /geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
Date Fri, 04 Aug 2006 02:38:24 GMT
Author: jdillon
Date: Thu Aug  3 19:38:23 2006
New Revision: 428595

URL: http://svn.apache.org/viewvc?rev=428595&view=rev
Log:
If -h or --help, then show usage, don't process custom options

Modified:
    geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java

Modified: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java?rev=428595&r1=428594&r2=428595&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
Thu Aug  3 19:38:23 2006
@@ -219,11 +219,16 @@
             CommandLineParser parser = new PosixParser();
             CommandLine line = parser.parse(options, Arguments.toStringArray(args));
 
+            // First check for help flags
+            boolean usage = line.hasOption('h');
+
             // Custom command-line processing
-            boolean usage = processCommandLine(line);
+            if (!usage) {
+                usage = processCommandLine(line);
+            }
 
             // Default command-line processing
-            if (usage || line.hasOption('h')) {
+            if (usage) {
                 displayHelp(options);
 
                 return Command.SUCCESS;



Mime
View raw message