diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index f10bdfe..2e62105 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -11,6 +11,9 @@ public class CommandListener { commands = new HashMap<>(); commands.put("help", new HelpCommand()); + + commands.put("exit", new QuitCommand()); + commands.put("quit", new QuitCommand()); } public HashMap returnCommands() { diff --git a/src/main/java/org/bitbiome/commands/QuitCommand.java b/src/main/java/org/bitbiome/commands/QuitCommand.java new file mode 100644 index 0000000..13e4e1e --- /dev/null +++ b/src/main/java/org/bitbiome/commands/QuitCommand.java @@ -0,0 +1,12 @@ +package org.bitbiome.commands; + +import java.util.Scanner; + +public class QuitCommand implements CommandAPI { + + @Override + public void performCommand(Scanner scanner, boolean isRunning, String message) { + System.out.println("You quitted!"); + System.exit(0); + } +}