You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bi...@apache.org on 2011/12/01 17:06:50 UTC

svn commit: r1209132 - /incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java

Author: billie
Date: Thu Dec  1 16:06:50 2011
New Revision: 1209132

URL: http://svn.apache.org/viewvc?rev=1209132&view=rev
Log:
ACCUMULO-170 merged to trunk

Modified:
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java?rev=1209132&r1=1209131&r2=1209132&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java Thu Dec  1 16:06:50 2011
@@ -22,9 +22,9 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.accumulo.core.util.shell.Shell;
+import org.apache.accumulo.core.util.shell.Shell.Command;
 import org.apache.accumulo.core.util.shell.ShellCommandException;
 import org.apache.accumulo.core.util.shell.Token;
-import org.apache.accumulo.core.util.shell.Shell.Command;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
@@ -49,12 +49,11 @@ public class HelpCommand extends Command
     
     // print help for every command on command line
     for (String cmd : cl.getArgs()) {
-      try {
-        shellState.commandFactory.get(cmd).printHelp();
-      } catch (Exception e) {
-        Shell.printException(e);
-        return 1;
-      }
+      Command c = shellState.commandFactory.get(cmd);
+      if (c == null)
+        shellState.getReader().printString(String.format("Unknown command \"%s\".  Enter \"help\" for a list possible commands.\n", cmd));
+      else
+        c.printHelp();
     }
     return 0;
   }