Skip to content

Commit

Permalink
Update user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
tllshan committed Sep 22, 2023
1 parent a89bf4f commit 01314f1
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 43 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ javafx {
}

run{
enableAssertions = false
enableAssertions = true
standardInput = System.in
}
158 changes: 131 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# User Guide

Duke is a desktop app for managing tasks, optimized for use via a Command Line Interface (CLI) while still having the
benefits of a Graphical User Interface (GUI).

- [Quick Start](#quick-start)
- [Features](#features)
- [Adding a todo: `todo`](#adding-a-todo---todo)
- [Adding a deadline: `deadline`](#adding-a-deadline---deadline)
- [Adding an event: `event`](#adding-an-event---event)
- [Printing the list: `list`](#printing-the-list---list)
- [Marking a task: `mark`](#marking-a-task---mark)
- [Unmarking a task: `unmark`](#unmarking-a-task---unmark)
- [Deleting a task: `delete`](#deleting-a-task---delete)
- [Finding in list: `find`](#finding-in-list---find)
- [Displaying statistics: `stats`](#displaying-statistics---stats)
- [Filtering completed tasks: `completed`](#filtering-completed-tasks---completed)
- [Filtering uncompleted tasks: `uncompleted`](#filtering-uncompleted-tasks---uncompleted)
- [Filtering todos: `todos`](#filtering-todos---todos)
- [Filtering deadlines: `deadlines`](#filtering-deadlines---deadlines)
- [Filtering events: `events`](#filtering-events---events)
- [Exiting the program: `bye`](#exiting-the-program---bye)
- [Command Summary](#command-summary)

---

## Quick Start

1. Ensure you have `Java 11` or above installed in your computer.
2. Download the latest duke.jar from [here](https://github.com/tllshan/ip/releases).
3. Copy the file to the folder you want to use as the home folder for your chatbot.
4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar duke.jar` commmand to run the application.
5. Type the command in the command box and press Enter to execute it. You may refer to the Features below for the details of each command.

---

## Features

### Adding a todo - `todo`
Expand All @@ -8,12 +42,14 @@ Adds a todo to the list.

Format: `todo DESCRIPTION`

- A todo is a task that has only a description.

Example: `todo read book`

Expected output:
```
Got it. I've added this task:
[][T] read book
[ ][T] read book
Now you have 1 tasks in the list.
```

Expand All @@ -23,27 +59,33 @@ Adds a deadline to the list

Format: `deadline DESCRIPTION /by DUE DATE`

- A deadline is a task that has a description and a due date.
- Date must be in the format YYYY-MM-DD.

Example: `deadline return book /by 2023-09-22`

Expected output:
```
Got it. I've added this task:
[][D] return book /by 2023-09-22
[ ][D] return book /by 2023-09-22
Now you have 2 tasks in the list.
```

### Adding an event - `event`

Adds an event to the list.

Format: `event DESCRIPTION /from START DATE /tp END DATE`
Format: `event DESCRIPTION /from START DATE /to END DATE`

- An event is a task that has a description, a start date, and an end date.
- Dates must be in the format YYYY-MM-DD.

Example" `event holiday /from 2023-12-20 /to 2023-12-25`

Expected output:
```
Got it. I've added this task:
[][E] return holidy /from 2023-12-20 /to 2023-12-25
[ ][E] return holidy /from 2023-12-20 /to 2023-12-25
Now you have 3 tasks in the list.
```

Expand All @@ -53,20 +95,28 @@ Prints a numbered list of tasks.

Format: `print`

- `X` indicates tasks that have been marked.
- `T`, `D`, and `E` tags indicate todos, deadlines and events respectively.
- Deadlines and events are printed with the relevant dates, formatted as DD/MM/YYYY.

Expected output:
```
Here are the tasks in your list:
1.[][T] read book
2.[][D] return book (by: 29/09/2023)
3.[][E] holiday (from: 20/12/2023 to: 25/12/2023)
1.[ ][T] read book
2.[ ][D] return book (by: 29/09/2023)
3.[ ][E] holiday (from: 20/12/2023 to: 25/12/2023)
```

### Marking a task as done - `mark`
### Marking a task - `mark`

Marks the task with an 'X' when the list is printed.
Marks a task as done.

Format: `mark TASK INDEX`

- Marks the task at the specified `TASK INDEX`.
- The index refers to the index number shown in list command.
- The index must be a positive integer.

Example: `mark 2`

Expected output:
Expand All @@ -75,41 +125,52 @@ Nice! I've marked this task as done:
[X][D] return book (by: 29/09/2023)
```

### Marking a task as not done - `unmark`
### Unmarking a task - `unmark`

Removes the 'X' when the list is printed.
Marks a task as not done yet.

Format: `unmark TASK INDEX`

- Unmarks the task at the specified `TASK INDEX`.
- The index refers to the index number shown in list command.
- The index must be a positive integer.

Example: `unmark 2`

Expected output:
```
OK, I've marked this task as not done yet:
[][D] return book (by: 29/09/2023)
[ ][D] return book (by: 29/09/2023)
```

### Deleting a task - `delete`

Deletes the task from the list.
Deletes a task from the list.

Format: `delete TASK INDEX`

- Deletes the task at the specified `TASK INDEX`.
- The index refers to the index number shown in list command.
- The index must be a positive integer.

Example: `delete 1`

Expected output:
```
Noted. I've removed this task.
[][T] read book
[ ][T] read book
Now you have 2 tasks in the list.
```

### Finding in list - `find`

Finds and lists all tasks containing the keyword or phrase.
Finds tasks containing a key word or phrase.

Format: `find KEYWORD`

- Finds and lists tasks with the given `KEYWORD`.
- The search is case-sensitive. e.g. `book` will not match `Book`.

Example: `find book`

Expected output:
Expand All @@ -118,52 +179,95 @@ Here are the matching tasks in your list:
1.[X][D] return book (by 29/09/2023)
```

### Counting types of each task - `stats`
### Displaying statistics - `stats`

Displays the number of each type of task.
Displays the number of each type of task, and the percentage of tasks completed.

Format: `stats`

Expected output:
```
Your tasklist consists of:
- 0 todos
- 1 deadlines
- 1 events
- 1 todos
- 2 deadlines
- 3 events
You are 66% done with all tasks.
```

### Counting completed tasks - `completed`
### Filtering completed tasks - `completed`

Displays the number of completed tasks.
Displays tasks that have been marked as done.

Format: `completed`

Expected output:
```
Congratulations! You have completed 1 of 2 tasks!
Congratulations! You have completed 2 of 3 tasks!
1.[X][T] read book
2.[X][E] holiday (from: 20/12/2023 to: 25/12/2023)
```

### Counting uncompleted tasks - `uncompleted`
### Filtering uncompleted tasks - `uncompleted`

Displays the number of uncompleted tasks.
Displays tasks that have not been marked as done.

Format: `uncompleted`

Expected output:
```
You still have 1 of 2 tasks uncompleted. Jia you!
You still have 1 of 3 tasks uncompleted. Jia you!
1.[ ][D] return book (by: 22/09/2023)
```

### Filtering todos - `todos`

Displays all todos in the list.

Format: `todos`

Expected output:
```
You have 1 todos on your list!
1.[X][T] read book
```

### Filtering deadlines - `deadlines`

Displays all deadlines in the list.

Format: `deadlines`

Expected output:
```
You have 2 deadlines on your list!
1.[ ][D] return book (by: 22/09/2023)
2.[X][D] submit report (by; 01/10/2023)
```

### Filtering events - `events`

Displays all events in the list.

Format: `events`

Expected output:
```
You have 2 events on your list!
1.[X][E] holiday (from: 20/12/2023 to: 25/12/2023)
2.[ ][E] exams (from: 30/11/2023 to: 05/12/2023)
```

### Exiting the program - `bye`

Displays exit message and quits program.
Displays exit message and disables user input.

Format: `bye`

Expected output:
```
Bye. Hope to see you again soon!
```
---

## Command Summary

Expand Down
8 changes: 4 additions & 4 deletions src/main/data/task-list.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Xtodo adsf
todo asdf
deadline adsf /by 2023-09-22
event thing /from 2023-09-22 /to 2023-09-22
Xtodo homework
todo life
event thing /from 2023-12-02 /to 2023-12-09
deadline thing /by 2023-09-22
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import duke.tasklist.TaskList;

public class PrintCompletedTasksCommand extends Command {
public class FilterCompletedTasksCommand extends Command {

private static final String COMMAND_RESPONSE = "Congratulations! You have completed %d of %d tasks!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import duke.tasklist.TaskList;

public class PrintDeadlinesCommand extends Command {
public class FilterDeadlinesCommand extends Command {

private static final String COMMAND_RESPONSE = "You have %d deadlines on your list!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import duke.tasklist.TaskList;

public class PrintEventsCommand extends Command {
public class FilterEventsCommand extends Command {

private static final String COMMAND_RESPONSE = "You have %d events on your list!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import duke.tasklist.TaskList;

public class PrintTodosCommand extends Command {
public class FilterTodosCommand extends Command {

private static final String COMMAND_RESPONSE = "You have %d todos on your list!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import duke.tasklist.TaskList;

public class PrintUncompletedTasksCommand extends Command {
public class FilterUncompletedTasksCommand extends Command {

private static final String COMMAND_RESPONSE = "You still have %d of %d tasks uncompleted. Jia you!";

Expand Down
11 changes: 5 additions & 6 deletions src/main/java/duke/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import duke.data.task.Task;
import duke.data.task.ToDo;

import javax.print.event.PrintEvent;
import java.time.LocalDate;
import java.time.format.DateTimeParseException;

Expand Down Expand Up @@ -49,15 +48,15 @@ public Command parseInput(String input) throws DukeException {
case "find":
return new FindTaskCommand(description);
case "completed":
return new PrintCompletedTasksCommand();
return new FilterCompletedTasksCommand();
case "uncompleted":
return new PrintUncompletedTasksCommand();
return new FilterUncompletedTasksCommand();
case "todos":
return new PrintTodosCommand();
return new FilterTodosCommand();
case "deadlines":
return new PrintDeadlinesCommand();
return new FilterDeadlinesCommand();
case "events":
return new PrintEventsCommand();
return new FilterEventsCommand();
case "stats":
return new PrintStatsCommand();
default:
Expand Down

0 comments on commit 01314f1

Please sign in to comment.