Skip to content

Commit

Permalink
A-UserGuide
Browse files Browse the repository at this point in the history
Add UserGuide for how to use Jarvis
  • Loading branch information
rgonslayer committed Sep 19, 2022
1 parent 428ca03 commit 66b954a
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 23 deletions.
7 changes: 3 additions & 4 deletions data/taskList.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
T | 0 | read book
D | 0 | return book | 2022-09-20
T | 0 | gym
T | 0 | code
T | 0 | read
D | 0 | return book | 2022-10-10
D | 0 | return book | 2022-10-10
112 changes: 99 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,115 @@
# User Guide
# User Guide for JARVIS

## Features
### 1. Adding tasks

### Feature-ABC
Description: Adds a task. There are 3 different types of tasks you can add: Todo, Deadline and Events.

Description of the feature.
#### - Add a Todo

### Feature-XYZ
Command: `todo {task}`

Description of the feature.
Example: `todo read book`

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

#### - Add a Deadline

Command: `deadline {task} /by date in yyyy-mm-dd format`

Example: `deadline return book /by 2022-10-10`

Expected outcome:
```
Got it. I've added this task:
[D][] return book (by: Oct 10 2022)
Now you have 2 tasks in the list.
```

#### - Add an Event

Command: `event {task} /at date in yyyy-mm-dd format`

### `Keyword` - Describe action
Example: `event project meeting /at 2022-10-10`

Describe the action and its outcome.
Expected outcome:
```
Got it. I've added this task:
[E][] project meeting (at: Oct 10 2022)
Now you have 3 tasks in the list.
```

Example of usage:
### 2. Deleting tasks

`keyword (optional arguments)`
Description: Deletes a task at the input task number

Command: `delete {task number}`

Example: `delete 1`

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

### 3. Listing your tasks

Description: Lists out all the tasks in the task list.

Description of the outcome.
Command: `list`

Expected outcome:
```
Here are the tasks in your task list:
1.[D][] return book (by: Oct 10 2022)
2.[E][] project meeting (at: Oct 10 2022)
```

### 4. Marking your tasks as done

Description: Marks the task of the input task number as done.

Command: `mark {task number}`

Example: `mark 1`

Expected outcome:
```
Great! I've marked this task as done:
[D][X]return book (by: Oct 10 2022)
```


### 5. Unmarking your tasks

Description: Unmarks the task of the input task number as not done.

Command: `unmark {task number}`

Example: `unmark 1`

Expected outcome:
```
Ok, I have marked this task as not done yet:
[D][]return book (by: Oct 10 2022)
```

### 6. Finding tasks

Description: Finds all the task that contains the keyword and list them out.

Command: `find {keyword}`

Example: `find book`

Expected outcome:
```
expected output
Here are the matching tasks in your list:
1.[D][]return book (by: Oct 10 2022)
```
14 changes: 8 additions & 6 deletions src/main/java/jarvis/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ private static String handleDelete(TaskList tasks, String input) {
tasks.getList().remove(toDelete);
String deleteResponse = "Noted. I have removed this task:\n ";
String output = deleteResponse + deleteTask.toString();
Task.minusCount();
output = output + "\nNow you have " + Task.getCount() + " tasks in the list.";
return output;
}

Expand All @@ -134,8 +136,8 @@ private static String handleToDo(TaskList tasks, String input) throws JarvisExce
throw new JarvisException("The description of a todo cannot be empty");
}
tasks.getList().add(new ToDo(description));
String output = ("Got it. I've added this task:\n " + tasks.getList().get(Task.getCount() - 1)
+ "\nNow you have " + (Task.getCount()) + " tasks in the list.");
String output = ("Got it. I've added this task:\n " + tasks.getList().get(tasks.getList().size() - 1)
+ "\nNow you have " + (tasks.getList().size()) + " tasks in the list.");
return output;
}

Expand All @@ -144,8 +146,8 @@ private static String handleDeadline(TaskList tasks, String input) {
String description = input.substring(9, divisor - 1);
String date = input.substring(divisor + 4);
tasks.getList().add(new Deadline(description, date));
String output = ("Got it. I've added this task:\n " + tasks.getList().get(Task.getCount() - 1)
+ "\nNow you have " + (Task.getCount()) + " tasks in the list.");
String output = ("Got it. I've added this task:\n " + tasks.getList().get(tasks.getList().size() - 1)
+ "\nNow you have " + (tasks.getList().size()) + " tasks in the list.");
return output;
}

Expand All @@ -154,8 +156,8 @@ private static String handleEvent(TaskList tasks, String input) {
String description = input.substring(6, divisor - 1);
String date = input.substring(divisor + 4);
tasks.getList().add(new Event(description, date));
String output = ("Got it. I've added this task:\n " + tasks.getList().get(Task.getCount() - 1)
+ "\nNow you have " + (Task.getCount()) + " tasks in the list.");
String output = ("Got it. I've added this task:\n " + tasks.getList().get(tasks.getList().size() - 1)
+ "\nNow you have " + (tasks.getList().size()) + " tasks in the list.");
return output;
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/jarvis/task/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@ public boolean getDone() {
public static int getCount() {
return count;
}

public static void minusCount() {
count--;
}
}

0 comments on commit 66b954a

Please sign in to comment.