summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2016-10-21 14:14:48 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2016-10-21 14:14:48 -0400
commit5cf7bcf156970fe72f79e40b8a6e320ea160ac83 (patch)
tree52bba3b684c493c726538194b5965150abb4a786 /BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
parentb0516949d7577b809c75d7267df77bff2cdb078b (diff)
Documentation
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.java17
1 files changed, 12 insertions, 5 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 e73d936..54d2fa0 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java
@@ -1,5 +1,7 @@
package bjc.utils.cli;
+import org.eclipse.jdt.annotation.Nullable;
+
/**
* Generic command implementation
*
@@ -18,19 +20,24 @@ public class GenericCommand implements ICommand {
* @param handler
* The handler to use for the command
* @param description
- * The description of the command
+ * The description of the command. May be null
* @param help
- * The detailed help message for the command
+ * The detailed help message for the command. May be null
*/
- public GenericCommand(ICommandHandler handler, String description,
- String help) {
+ public GenericCommand(ICommandHandler handler, @Nullable String description,
+ @Nullable String help) {
if (handler == null) {
throw new NullPointerException(
"Command handler must not be null");
}
this.handler = handler;
- this.help = new GenericHelp(description, help);
+
+ if (description == null) {
+ this.help = new NullHelp();
+ } else {
+ this.help = new GenericHelp(description, help);
+ }
}
@Override