Skip to content

Commit

Permalink
Merge pull request #17 from WinstonLeonard/final-tweaks
Browse files Browse the repository at this point in the history
Final tweaks
  • Loading branch information
WinstonLeonard authored Sep 20, 2023
2 parents b1e6944 + 8d848df commit 8821f27
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
Binary file added docs/Ui.png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/main/data/duke.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[D][X] do hw (by: Sep 14 2023, 15:00)
[E][ ] PINUS (from: Sep 14 2023, 15:00 to: Sep 14 2023, 16:00)
[E][X] SOMETHING (from: Aug 31 2023, 12:00 to: Aug 31 2023, 13:00)
[T][X] CS2100 HW
[D][ ] CS2103T assignment (by: Sep 21 2023, 23:59)
[E][ ] CS2103T Team Meeting (from: Sep 21 2023, 21:00 to: Sep 21 2023, 22:00)
[T][ ] CS2100 assignment
29 changes: 29 additions & 0 deletions src/main/java/duke/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,33 @@ public String updateTime(String description, char number) throws NotANumberExcep
}
}

public String help() {
return "Here is a list of my commands:\n " +
"1. todo taskDescription. This adds a todo task to your list of tasks.\n" +
"\tExample Usage:\n" +
"\ttodo Homework\n\n" +
"2. deadline taskDescription /by dd-mm-yy HH:MM. This adds a deadline task your list of tasks.\n" +
"\tExample Usage:\n" +
"\tdeadline CS2103T assignment /by 21-09-2023 23:59\n\n" +
"3. event taskDescription /from dd-mm-yy HH:MM /to dd-mm-yy HH:MM. This adds an event to your list of tasks.\n" +
"\tExample Usage: \n" +
"\tevent CS2103T Team Meeting /from 21-09-2023 21:00 /to 21-09-2023 22:00\n\n" +
"4. list. This command displays the list of tasks you have.\n\n" +
"5. mark taskNumber. This command marks the corresponding task in the list as done\n" +
"\tExample Usage: \n" +
"\t mark 1\n\n" +
"6. unmark taskNumber. This command unmarks the corresponding task in the list\n" +
"\tExample Usage:\n" +
"\tunmark 1\n\n" +
"7. delete taskNumber. This command deletes the corresponding task from the list\n" +
"\tExample Usage:\n" +
"\tdelete 1\n\n" +
"8. find taskDescription. This command returns a list of task that matches the taskName given\n" +
"\tExample Usage:\n" +
"\tfind CS2103T\n\n" +
"9.update taskNumber /by dd-mm-yy HH:MM. This command updates the time of an event or deadline task.\n" +
"\tExample Usage: \n" +
"\tupdate 2 /by 30-09-2023 23:59";
}

}
2 changes: 2 additions & 0 deletions src/main/java/duke/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public String startUi(String echo) {
String description = String.join(" ", Arrays.copyOfRange(words, 2, words.length));
char number = completeDescription.charAt(0);
return tasks.updateTime(description, number);
} else if (words[0].equalsIgnoreCase("help")) {
return tasks.help();
}
else {
throw new InvalidCommandException();
Expand Down

0 comments on commit 8821f27

Please sign in to comment.