diff --git a/docs/README.md b/docs/README.md index bbd492e3d8..0a6d0fd99d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,9 +11,12 @@ Prerequisites: Java 11. 3. Go into the directory containing the ip.jar file. 1. Use `cd` to enter the directory. 2. Use `ls` or `dir` to list all the files in the specific directory. -4. Type `java -jar ip.jar` into the command prompt. -5. Enter to start the program. +4. Type `chcp 65001` into the command prompt. +5. Press enter at the command prompt. +6. Type `java -Dfile.encoding=UTF-8 -jar ip.jar` into the command prompt. +7. Press enter to start the program. +> Note: If the status icons appear as ? instead of ✓ or ✘, change the font of the command promp to NSimSun. ``` Hello from diff --git a/src/main/java/duke/commands/FindCommand.java b/src/main/java/duke/commands/FindCommand.java index 7e323f1f0f..4c81cbbb7d 100644 --- a/src/main/java/duke/commands/FindCommand.java +++ b/src/main/java/duke/commands/FindCommand.java @@ -27,20 +27,26 @@ public FindCommand(String userCommand) { */ @Override public void execute(TaskList taskList, Storage storage) { - int numberOfTasks = taskList.getSize(); + int numberOfTasks = 0; ArrayList currentList = new ArrayList<>(); try { String userCommandDescription = userCommand.substring(Constants.LENGTH_OF_FIND+1).trim(); - for(int i=0; i list) { printDashLine(); System.out.println("Here are the matching tasks in your list: "); @@ -180,6 +186,15 @@ public static void printFind(ArrayList list) { printDashLine(); } + /** + * Prints the message when all the tasks do not contain the keywords. + */ + public static void printFindNothing() { + printDashLine(); + System.out.println("There is no matching task in your list. "); + printDashLine(); + } + /** * Prints the error message when there is problems with the formatting. */