Skip to content

Commit

Permalink
Provide in-App guidance to users
Browse files Browse the repository at this point in the history
Add a command to access help page
  • Loading branch information
JJtan2002 committed Sep 11, 2024
1 parent 0ee7a77 commit 66332d5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/echobot/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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 <task number>: Marks the specified task as completed.");
System.out.println(" - unmark <task number>: Unmarks the specified task as incomplete.");
System.out.println(" - todo <task description>: Adds a new to-do task.");
System.out.println(" - deadline <task description> /by <dd/MM/yyyy>: Adds a task with a deadline.");
System.out.println(" - event <task description> /at <dd/MM/yyyy>: Adds an event with a specific date.");
System.out.println(" - delete <task number>: Deletes the specified task.");
System.out.println(" - findbydate <dd/MM/yyyy>: Finds tasks scheduled on the specified date.");
System.out.println(" - find <keyword>: Finds tasks that contain the specified keyword.");
System.out.println(" - help: Shows this help message with all available commands.");
}
}

0 comments on commit 66332d5

Please sign in to comment.