From 416c8a90cceb37c3bf8c8560d285b4be8e6d1cc6 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Wed, 16 Dec 2020 20:44:25 -0500 Subject: Minor tweaks --- .../main/java/bjc/utils/cli/GenericCommand.java | 49 ++++++---------------- 1 file changed, 12 insertions(+), 37 deletions(-) (limited to 'base/src/main/java/bjc/utils/cli/GenericCommand.java') 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; @@ -56,16 +41,6 @@ public class GenericCommand implements Command { return help; } - @Override - public boolean isAlias() { - return false; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return String.format("GenericCommand [help=%s]", help); -- cgit v1.2.3