diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-12-16 20:44:25 -0500 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-12-16 20:44:25 -0500 |
| commit | 416c8a90cceb37c3bf8c8560d285b4be8e6d1cc6 (patch) | |
| tree | 28f541c92d9da443084b83d5bd108600fa2c047d /base/src/main/java/bjc/utils/cli/GenericCommandMode.java | |
| parent | 6dcadc360dafdd12142d53327f44579379a4c9dd (diff) | |
Minor tweaks
Diffstat (limited to 'base/src/main/java/bjc/utils/cli/GenericCommandMode.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/cli/GenericCommandMode.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/base/src/main/java/bjc/utils/cli/GenericCommandMode.java b/base/src/main/java/bjc/utils/cli/GenericCommandMode.java index 60c51a8..3642137 100644 --- a/base/src/main/java/bjc/utils/cli/GenericCommandMode.java +++ b/base/src/main/java/bjc/utils/cli/GenericCommandMode.java @@ -55,12 +55,12 @@ public class GenericCommandMode implements CommandMode { throw new NullPointerException("Error output source must be non-null"); this.normalOutput = normalOutput; - this.errorOutput = errorOutput; + this.errorOutput = errorOutput; /* Initialize maps so that they sort in alphabetical order. */ commandHandlers = new FunctionalMap<>(new TreeMap<>()); defaultHandlers = new FunctionalMap<>(new TreeMap<>()); - helpTopics = new FunctionalMap<>(new TreeMap<>()); + helpTopics = new FunctionalMap<>(new TreeMap<>()); /* Setup default commands. */ setupDefaultCommands(); @@ -84,17 +84,16 @@ public class GenericCommandMode implements CommandMode { if (commandName == null) { throw new NullPointerException("Command name must not be null"); } else if (aliasName == null) { - String msg = "Alias name must not be null"; - throw new NullPointerException(msg); + throw new NullPointerException("Alias name must not be null"); } else if (!commandHandlers.containsKey(commandName) && !defaultHandlers.containsKey(commandName)) { - String msg = String.format("Cannot alias non-existant command '%s'", + String msg = String.format("Cannot alias non-existing command '%s'", commandName); throw new IllegalArgumentException(msg); } else if (commandHandlers.containsKey(aliasName) || defaultHandlers.containsKey(aliasName)) { String msg = String.format( - "Cannot bind alias '%s' to an already bound command.", aliasName); + "Cannot bind alias '%s' to an already used name.", aliasName); throw new IllegalArgumentException(msg); } else { /* The command that will be aliased. */ |
