You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by sf...@apache.org on 2010/02/03 15:03:43 UTC

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

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);
         }