summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java b/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
index 529635d..1a95018 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
@@ -7,7 +7,9 @@ package bjc.utils.cli;
*
*/
public class GenericCommand implements ICommand {
+ // The behavior for invoking the command
private ICommandHandler handler;
+ // The help for the command
private ICommandHelp help;
/**
@@ -22,17 +24,16 @@ public class GenericCommand implements ICommand {
*/
public GenericCommand(ICommandHandler handler, String description,
String help) {
+ if(handler == null) {
+ throw new NullPointerException("Command handler must not be null");
+ }
+
this.handler = handler;
this.help = new GenericHelp(description, help);
}
-
- /**
- * Create a command that is an alias to this one
- *
- * @return A command that is an alias to this one
- */
+
@Override
- public ICommand createAlias() {
+ public ICommand aliased() {
return new DelegatingCommand(this);
}