HADOOP-8074. Small bug in hadoop error message for unknown commands. Contributed by Colin Patrick McCabe

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1244766 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-02-15 22:23:20 +00:00
parent ff91453227
commit 1ceb0eeaf4
2 changed files with 12 additions and 1 deletions

View File

@ -190,6 +190,9 @@ Release 0.23.2 - UNRELEASED
Double.MAX_VALUE) to avoid making Ganglia's gmetad core. (Varun Kapoor Double.MAX_VALUE) to avoid making Ganglia's gmetad core. (Varun Kapoor
via mattf) via mattf)
HADOOP-8074. Small bug in hadoop error message for unknown commands.
(Colin Patrick McCabe via eli)
Release 0.23.1 - 2012-02-08 Release 0.23.1 - 2012-02-08
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -269,7 +269,15 @@ public class FsShell extends Configured implements Tool {
private void displayError(String cmd, String message) { private void displayError(String cmd, String message) {
for (String line : message.split("\n")) { for (String line : message.split("\n")) {
System.err.println(cmd.substring(1) + ": " + line); System.err.println(cmd + ": " + line);
if (cmd.charAt(0) != '-') {
Command instance = null;
instance = commandFactory.getInstance("-" + cmd);
if (instance != null) {
System.err.println("Did you mean -" + cmd + "? This command " +
"begins with a dash.");
}
}
} }
} }