diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index d5fdcdb2686..d30f8ea3f0f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -38,6 +38,9 @@ Release 0.23.2 - UNRELEASED Double.MAX_VALUE) to avoid making Ganglia's gmetad core. (Varun Kapoor 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 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShell.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShell.java index 376ea79586b..4da32789e5c 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShell.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShell.java @@ -269,7 +269,15 @@ public class FsShell extends Configured implements Tool { private void displayError(String cmd, String message) { 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."); + } + } } }