From 66332d522018b6eee12f3bd953f35234cb66214b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Sep 2024 10:22:52 +0800 Subject: [PATCH] Provide in-App guidance to users Add a command to access help page --- src/main/java/echobot/Command.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/echobot/Command.java b/src/main/java/echobot/Command.java index 338129a774..00d5fc6c8c 100644 --- a/src/main/java/echobot/Command.java +++ b/src/main/java/echobot/Command.java @@ -119,12 +119,16 @@ public void run() { Storage.saveTasksToFile(tasks); break; } + case "help": { + handleHelpCommand(); + } case "find": { handleFindCommand(inputParts); break; } default: System.out.println(" I'm sorry, I don't recognize that command."); + System.out.println(" Type 'help' to see my available commands!"); break; } } @@ -345,4 +349,19 @@ private void handleFindCommand(String[] inputParts) { System.out.println("No tasks found containing the keyword: " + keyword); } } + + private void handleHelpCommand() { + System.out.println("Available Commands:"); + System.out.println(" - bye: Exits the chatbot."); + System.out.println(" - list: Lists all current tasks."); + System.out.println(" - mark : Marks the specified task as completed."); + System.out.println(" - unmark : Unmarks the specified task as incomplete."); + System.out.println(" - todo : Adds a new to-do task."); + System.out.println(" - deadline /by
: Adds a task with a deadline."); + System.out.println(" - event /at
: Adds an event with a specific date."); + System.out.println(" - delete : Deletes the specified task."); + System.out.println(" - findbydate
: Finds tasks scheduled on the specified date."); + System.out.println(" - find : Finds tasks that contain the specified keyword."); + System.out.println(" - help: Shows this help message with all available commands."); + } }