summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/cli/objects/Command.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:19:02 -0500
committerbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:19:02 -0500
commit32f5da54c628408c96db09d279f3a7ef44b3bd19 (patch)
treeef56d04518b8791409ed65db58c304b74b23a01b /base/src/main/java/bjc/utils/cli/objects/Command.java
parent49cd96c4c5bbb883c0c5c10d7916ad2e93ff2df0 (diff)
Update
Diffstat (limited to 'base/src/main/java/bjc/utils/cli/objects/Command.java')
-rw-r--r--base/src/main/java/bjc/utils/cli/objects/Command.java40
1 files changed, 23 insertions, 17 deletions
diff --git a/base/src/main/java/bjc/utils/cli/objects/Command.java b/base/src/main/java/bjc/utils/cli/objects/Command.java
index 3a7d452..04cdfd9 100644
--- a/base/src/main/java/bjc/utils/cli/objects/Command.java
+++ b/base/src/main/java/bjc/utils/cli/objects/Command.java
@@ -38,15 +38,15 @@ public class Command {
/**
* The full text of this command.
*/
- public final String fullCommand;
+ public final String fullCommand;
/**
* The text of this command without its name.
*/
- public final String remnCommand;
+ public final String remnCommand;
/**
* The name of this command.
*/
- public final String nameCommand;
+ public final String nameCommand;
/**
* The name of the I/O source this command was read from.
@@ -57,13 +57,13 @@ public class Command {
* Create a new command.
*
* @param ln
- * The string to get the command from.
+ * The string to get the command from.
*
* @param lno
- * The number of the line the command came from.
+ * The number of the line the command came from.
*
* @param ioSrc
- * The name of where the I/O came from.
+ * The name of where the I/O came from.
*/
public Command(String ln, int lno, String ioSrc) {
int idx = ln.indexOf(' ');
@@ -87,17 +87,18 @@ public class Command {
* through the line.
*
* @param ln
- * The string to get the command from.
+ * The string to get the command from.
*
* @param lno
- * The line number of the command.
+ * The line number of the command.
*
* @param ioSource
- * The name of where the I/O came from.
+ * The name of where the I/O came from.
+ * @return The parsed command
*/
public static Command fromString(String ln, int lno, String ioSource) {
/* Ignore blank lines and comments. */
- if(ln.equals("")) return null;
+ if(ln.equals("")) return null;
if(ln.startsWith("#")) return null;
/* Trim off comments part-way through the line. */
@@ -114,10 +115,11 @@ public class Command {
* command.
*
* @param info
- * The informational message.
+ * The informational message.
*
* @param parms
- * The parameters for the informational message.
+ * The parameters for the informational message.
+ * @return The information message.
*/
public String info(String info, Object... parms) {
String msg = String.format(info, parms);
@@ -129,10 +131,12 @@ public class Command {
* Warn about something in relation to this command.
*
* @param warning
- * The warning message.
+ * The warning message.
*
* @param parms
- * The parameters for the warning message.
+ * The parameters for the warning message.
+ *
+ * @return The formatted warning.
*/
public String warn(String warning, Object... parms) {
String msg = String.format(warning, parms);
@@ -143,11 +147,13 @@ public class Command {
/**
* Give an error about something in relation to this command.
*
- * @param error
- * The error message.
+ * @param err
+ * The error message.
*
* @param parms
- * The parameters for the error message.
+ * The parameters for the error message.
+ *
+ * @return The formatted error
*/
public String error(String err, Object... parms) {
String msg = String.format(err, parms);