chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfermig...@apache.org
Subject svn commit: r906050 - /incubator/chemistry/trunk/chemistry/chemistry-shell/src/main/java/org/apache/chemistry/shell/cmds/base/Help.java
Date Wed, 03 Feb 2010 14:03:43 GMT
Author: sfermigier
Date: Wed Feb  3 14:03:42 2010
New Revision: 906050

URL: http://svn.apache.org/viewvc?rev=906050&view=rev
Log:
Use synopsis when help is not available.


Modified:
    incubator/chemistry/trunk/chemistry/chemistry-shell/src/main/java/org/apache/chemistry/shell/cmds/base/Help.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-shell/src/main/java/org/apache/chemistry/shell/cmds/base/Help.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-shell/src/main/java/org/apache/chemistry/shell/cmds/base/Help.java?rev=906050&r1=906049&r2=906050&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-shell/src/main/java/org/apache/chemistry/shell/cmds/base/Help.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-shell/src/main/java/org/apache/chemistry/shell/cmds/base/Help.java
Wed Feb  3 14:03:42 2010
@@ -51,7 +51,11 @@
     private void printHelpForCommand(Application app, String cmdName) throws CommandException
{
         Command cmd = app.getCommandRegistry().getCommand(cmdName);
         if (cmd != null) {
-            println(cmd.getHelp());
+            String help = cmd.getHelp();
+            if (help.isEmpty()) {
+                help = cmd.getSynopsis();
+            }
+            println(help);
         } else {
             throw new CommandException("Unknown command: " + cmdName);
         }



Mime
View raw message