summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/cli/GenericCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/main/java/bjc/utils/cli/GenericCommand.java')
-rw-r--r--base/src/main/java/bjc/utils/cli/GenericCommand.java49
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);
}