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/GenericCommand.java | |
| parent | 6dcadc360dafdd12142d53327f44579379a4c9dd (diff) | |
Minor tweaks
Diffstat (limited to 'base/src/main/java/bjc/utils/cli/GenericCommand.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/cli/GenericCommand.java | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/base/src/main/java/bjc/utils/cli/GenericCommand.java b/base/src/main/java/bjc/utils/cli/GenericCommand.java index a847bea..6903152 100644 --- a/base/src/main/java/bjc/utils/cli/GenericCommand.java +++ b/base/src/main/java/bjc/utils/cli/GenericCommand.java @@ -12,40 +12,25 @@ public class GenericCommand implements Command { /* The help for the command. */ private CommandHelp help; - /** - * Create a new generic command. + /** Create a new generic command. * - * @param handler - * The handler to use for the command. - * - * @param description - * The description of the command. May be null, in which case - * a default is provided. - * - * @param help - * The detailed help message for the command. May be null, in - * which case the description is repeated for the detailed - * help. - */ - public GenericCommand(final CommandHandler handler, final String description, - final String help) { + * @param handler The handler to use for the command. + * @param summary The summary of the command. May be null, in which case a + * default is provided. + * @param description The detailed help message for the command. May be null, + * in which case the summary is repeated for the + * detailed help. */ + public GenericCommand(final CommandHandler handler, final String summary, + final String description) { if (handler == null) throw new NullPointerException("Command handler must not be null"); this.handler = handler; - if (description == null) { - this.help = new NullHelp(); - } else { - this.help = new GenericHelp(description, help); - } - } - - @Override - public Command aliased() { - return new DelegatingCommand(this); + if (summary == null) this.help = new NullHelp(); + else this.help = new GenericHelp(summary, description); } - + @Override public CommandHandler getHandler() { return handler; @@ -57,16 +42,6 @@ public class GenericCommand implements Command { } @Override - public boolean isAlias() { - return false; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override public String toString() { return String.format("GenericCommand [help=%s]", help); } |
