diff --git a/console/src/main/java/org/jline/console/impl/AbstractCommandRegistry.java b/console/src/main/java/org/jline/console/impl/AbstractCommandRegistry.java index 610015ab..673513f8 100644 --- a/console/src/main/java/org/jline/console/impl/AbstractCommandRegistry.java +++ b/console/src/main/java/org/jline/console/impl/AbstractCommandRegistry.java @@ -162,9 +162,9 @@ public Map commandAliases() { @SuppressWarnings("unchecked") public > void rename(V command, String newName) { if (nameCommand.containsKey(newName)) { - throw new IllegalArgumentException("Duplicate command name!"); + throw new IllegalArgumentException("Duplicate command name '" + command + "'!"); } else if (!commandName.containsKey(command)) { - throw new IllegalArgumentException("Command does not exists!"); + throw new IllegalArgumentException("Command '" + command + "' does not exists!"); } commandName.put((T) command, newName); doNameCommand(); @@ -172,7 +172,7 @@ public > void rename(V command, String newName) { public void alias(String alias, String command) { if (!nameCommand.containsKey(command)) { - throw new IllegalArgumentException("Command does not exists!"); + throw new IllegalArgumentException("Command '" + command + "' does not exists!"); } aliasCommand.put(alias, command); } @@ -198,7 +198,7 @@ public T command(String name) { if (nameCommand.containsKey(name)) { out = nameCommand.get(name); } else { - throw new IllegalArgumentException("Command does not exists!"); + throw new IllegalArgumentException("Command '" + name + "' does not exists!"); } return out; } @@ -230,7 +230,7 @@ public > void rename(V command, String newName) { public void alias(String alias, String command) { if (!commandExecute.containsKey(command)) { - throw new IllegalArgumentException("Command does not exists!"); + throw new IllegalArgumentException("Command '" + command + "' does not exists!"); } aliasCommand.put(alias, command); }