You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/08/04 04:38:24 UTC

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

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;