Return-Path: X-Original-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A5547977 for ; Thu, 1 Dec 2011 16:07:14 +0000 (UTC) Received: (qmail 96535 invoked by uid 500); 1 Dec 2011 16:07:14 -0000 Delivered-To: apmail-incubator-accumulo-commits-archive@incubator.apache.org Received: (qmail 96512 invoked by uid 500); 1 Dec 2011 16:07:14 -0000 Mailing-List: contact accumulo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-commits@incubator.apache.org Received: (qmail 96505 invoked by uid 99); 1 Dec 2011 16:07:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 16:07:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 16:07:12 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0E64023888EA; Thu, 1 Dec 2011 16:06:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1209132 - /incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java Date: Thu, 01 Dec 2011 16:06:50 -0000 To: accumulo-commits@incubator.apache.org From: billie@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111201160651.0E64023888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; }