diff options
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java b/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java index 5208657..f6313af 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java +++ b/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java @@ -9,21 +9,6 @@ package bjc.utils.cli; */ public interface ICommandMode { /** - * Process a command in this mode - * - * @param command - * The command to process - * @param args - * A list of arguments to the command - * @return The command mode to use for the next command. Defaults to - * returning this, and doing nothing else - */ - public default ICommandMode processCommand(String command, - String[] args) { - return this; - }; - - /** * Check to see if this mode can handle the specified command * * @param command @@ -33,6 +18,19 @@ public interface ICommandMode { */ public default boolean canHandleCommand(String command) { return false; + }; + + /** + * Get the custom prompt for this mode + * + * @return the custom prompt for this mode + * + * @throws UnsupportedOperationException + * if this mode doesn't support a custom prompt + */ + public default String getCustomPrompt() { + throw new UnsupportedOperationException( + "This mode doesn't support a custom prompt"); } /** @@ -45,24 +43,26 @@ public interface ICommandMode { } /** - * Check if this mode uses a custom prompt + * Process a command in this mode * - * @return Whether or not this mode uses a custom prompt + * @param command + * The command to process + * @param args + * A list of arguments to the command + * @return The command mode to use for the next command. Defaults to + * returning this, and doing nothing else */ - public default boolean useCustomPrompt() { - return false; + public default ICommandMode processCommand(String command, + String[] args) { + return this; } /** - * Get the custom prompt for this mode - * - * @return the custom prompt for this mode + * Check if this mode uses a custom prompt * - * @throws UnsupportedOperationException - * if this mode doesn't support a custom prompt + * @return Whether or not this mode uses a custom prompt */ - public default String getCustomPrompt() { - throw new UnsupportedOperationException( - "This mode doesn't support a custom prompt"); + public default boolean useCustomPrompt() { + return false; } } |
