From b27fbdccb6084c942967c393f3f20f27d4e3aba7 Mon Sep 17 00:00:00 2001 From: shunjieee Date: Thu, 29 Feb 2024 23:39:50 +0800 Subject: [PATCH] README.md: Add User Guide --- docs/README.md | 159 +++++++++++++++++++++++-- src/main/java/command/FindCommand.java | 2 +- 2 files changed, 148 insertions(+), 13 deletions(-) diff --git a/docs/README.md b/docs/README.md index 8077118ebe..390854f516 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,29 +1,164 @@ -# User Guide +# Xavier User Guide +## Introduction + +![Ui](./Ui.png) +Xavier is a simple chatbot which helps to manage your daily tasks! + +Download it from [here](https://github.com/shunjieee/ip/releases/download/A-Release/xavier.jar) now! + +--- ## Features +List of features supported: +* Add +* Delete +* List +* Mark +* Unmark +* Find +* Sort +* Exit + +### Adding a task: `todo`, `deadline` and `event` + +There are three types tasks that Xavier supports, to-do, deadline and event. The commands add the respective task to the task list. + +**todo** +Formart: `todo ` + +Example: +`todo wash dishes` + +Expected outcome: +``` +Got it. I've added this task: + [T][ ] wash dishes +Now you have 1 tasks in the list. +``` +**deadline** +Format: `deadline /by ` + +Example: +`deadline CS2103T Quiz 7 /by 7/3/2024-2359` + +Expected outcome: +``` +Got it. I've added this task: + [D][ ] CS2103T Quiz 7 (by: Mar 07 2024, 23:59) +Now you have 2 tasks in the list. +``` +**event** +Format: `event /from /to ` + + +Example: +`event Taylor Swift Concert /from 3/3/2024-1900 /to 3/3/2024-2200` + +Expected outcome: +``` +Got it. I've added this task: + [E][ ] Taylor Swift Concert (from: Mar 03 2024, 19:00 to: Mar 03 2024, 22:00) +Now you have 3 tasks in the list. +``` + +> [!IMPORTANT] +> The date-time format **MUST** be in **dd/MM/yyyy-HHmm**. + +### Deleting a task: `delete` + +Format: +`delete ` + +Example: +`delete 1` -### Feature-ABC +Expected outcome: +``` +Noted, I've removed this task: + [T][ ] wash dishes +Now you have 2 tasks in the list. +``` + +### Listing all the task in the list: `list` -Description of the feature. +Format: +`list` + +Example and expected outcome: +``` +Here are the tasks in your list: +1. [D][ ] CS2103T Quiz 7 (by: Mar 07 2024, 23:59) +2. [E][ ] Taylor Swift Concert (from: Mar 03 2024, 19:00 to: Mar 03 2024, 22:00) +``` + +### Marking task as done: `mark` + +Format: +`mark ` + +Example: +`mark 1` + +Expected outcome: +``` +Nice! I've marked this task as done: + [D][X] CS2103T Quiz 7 (by: Mar 07 2024, 23:59) +``` -### Feature-XYZ +### Unmarking task: `unmark` -Description of the feature. +Format: +`unmark ` -## Usage +Example: +`mark 2` -### `Keyword` - Describe action +Expected outcome: +``` +OK, I've marked this task as not done yet: + [E][ ] Taylor Swift Concert (from: Mar 03 2024, 19:00 to: Mar 03 2024, 22:00) +``` -Describe the action and its outcome. +### Finding tasks in the list: `find` -Example of usage: +Format: +`find ` -`keyword (optional arguments)` +Example: +`find Quiz` Expected outcome: +``` +Here are the matching tasks in your list: +1. [D][X] CS2103T Quiz 7 (by: Mar 07 2024, 23:59) +``` +> [!NOTE] +> `keyword` is case sensitive. + +### Sorting the list: `sort` -Description of the outcome. +The list will be sorting with the unmark tasks at the top and marked tasks at the bottom. In each section, the tasks will be sorted alphabetically. +Format: +`sort` + +Example and expected outcome: +``` +Here are the tasks in your list: +1. [E][ ] Taylor Swift Concert (from: Mar 03 2024, 19:00 to: Mar 03 2024, 22:00) +2. [D][X] CS2103T Quiz 7 (by: Mar 07 2024, 23:59) ``` -expected output + +### Exiting the program: `bye` + +The program will save the list in `./data/data.txt` before exiting. + +Format: +`bye` + +Example and expected outcome **(only CLI)**: ``` +Saving data ... +Data saved successfully. :) +Bye. Hope to see you again soon! +``` \ No newline at end of file diff --git a/src/main/java/command/FindCommand.java b/src/main/java/command/FindCommand.java index f95501a949..bd4c4a903c 100644 --- a/src/main/java/command/FindCommand.java +++ b/src/main/java/command/FindCommand.java @@ -37,7 +37,7 @@ public String execute() { for (Task t : tl) { if (t.hasKeyword(keyword)) { String taskString = counter + ". " + t.toString(); - System.out.print(taskString); + System.out.println(taskString); result += taskString + "\n"; counter++;