From ec465edd56202b976c12854bc4e8b236a78dab66 Mon Sep 17 00:00:00 2001 From: liuzehui03 Date: Wed, 20 Mar 2024 15:41:56 +0800 Subject: [PATCH 1/4] modify help command --- src/main/java/seedu/bookbuddy/Ui.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/seedu/bookbuddy/Ui.java b/src/main/java/seedu/bookbuddy/Ui.java index ac324d0439..085aa6d638 100644 --- a/src/main/java/seedu/bookbuddy/Ui.java +++ b/src/main/java/seedu/bookbuddy/Ui.java @@ -38,8 +38,12 @@ public static void removeBookMessage(int index) { System.out.println("alright.. i've removed " + BookList.books.get(index).getTitle() + " from the list."); } public static void helpMessage() { + System.out.println("Here's a list of commands to get you started!!"); System.out.println("add (Bookname) -> to add new books to the list"); System.out.println("list -> to show whole list of added books"); System.out.println("remove (index) -> to remove the book from the corresponding index"); + System.out.println("mark (index) -> to mark book as read [R]"); + System.out.println("unmark (index) -> to unmark book as unread [U]"); + System.out.println("bye -> to exit BookBuddy software"); } } From 8f7a0d54faf3c1cc9321ad05bbd908249d0f610a Mon Sep 17 00:00:00 2001 From: liuzehui03 Date: Wed, 20 Mar 2024 16:14:02 +0800 Subject: [PATCH 2/4] fix catch Invalid Command Exception error --- src/main/java/seedu/bookbuddy/BookBuddy.java | 3 +++ src/main/java/seedu/bookbuddy/Parser.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/bookbuddy/BookBuddy.java b/src/main/java/seedu/bookbuddy/BookBuddy.java index 76d5d6b6a3..39f21654bf 100644 --- a/src/main/java/seedu/bookbuddy/BookBuddy.java +++ b/src/main/java/seedu/bookbuddy/BookBuddy.java @@ -1,5 +1,6 @@ package seedu.bookbuddy; +import exceptions.InvalidCommandArgumentException; import exceptions.UnsupportedCommandException; import java.util.Scanner; @@ -32,6 +33,8 @@ public static void getUserInput(BookList books) { Parser.parseCommand(userInput, books); } catch (UnsupportedCommandException e) { System.out.println(e.getMessage()); + } catch (InvalidCommandArgumentException e) { + System.out.println(e.getMessage()); } } } diff --git a/src/main/java/seedu/bookbuddy/Parser.java b/src/main/java/seedu/bookbuddy/Parser.java index 7083eab7f9..d75e3e8aa2 100644 --- a/src/main/java/seedu/bookbuddy/Parser.java +++ b/src/main/java/seedu/bookbuddy/Parser.java @@ -59,7 +59,7 @@ public static void parseCommand( String input, BookList books) { System.exit(0); break; default: - throw new UnsupportedCommandException("Sorry but that is not a valid command. Please try again"); + throw new UnsupportedCommandException("Sorry but that is not a valid command use (help) to find out valid commands!"); } } catch (NumberFormatException e) { throw new InvalidBookIndexException("Book index must be an integer."); From 009e65f6a0157408ffd0fa5850064f7c17399af4 Mon Sep 17 00:00:00 2001 From: liuzehui03 Date: Wed, 20 Mar 2024 16:24:32 +0800 Subject: [PATCH 3/4] fix checkstyle --- src/main/java/seedu/bookbuddy/Parser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/bookbuddy/Parser.java b/src/main/java/seedu/bookbuddy/Parser.java index d75e3e8aa2..10b678a66b 100644 --- a/src/main/java/seedu/bookbuddy/Parser.java +++ b/src/main/java/seedu/bookbuddy/Parser.java @@ -59,7 +59,8 @@ public static void parseCommand( String input, BookList books) { System.exit(0); break; default: - throw new UnsupportedCommandException("Sorry but that is not a valid command use (help) to find out valid commands!"); + throw new UnsupportedCommandException("Sorry but that is not a valid command " + + "use (help) to find out valid commands!"); } } catch (NumberFormatException e) { throw new InvalidBookIndexException("Book index must be an integer."); From 7d7b4e3a7b9645706906230177fcc5d3d81d8ad6 Mon Sep 17 00:00:00 2001 From: liuzehui03 Date: Wed, 20 Mar 2024 17:16:15 +0800 Subject: [PATCH 4/4] Merge branch 'help_feature' of https://github.com/liuzehui03/tp into help_feature # Conflicts: # src/main/java/seedu/bookbuddy/Parser.java --- src/main/java/seedu/bookbuddy/Parser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/seedu/bookbuddy/Parser.java b/src/main/java/seedu/bookbuddy/Parser.java index 28a428d7b3..84a72b538e 100644 --- a/src/main/java/seedu/bookbuddy/Parser.java +++ b/src/main/java/seedu/bookbuddy/Parser.java @@ -66,8 +66,7 @@ public static void parseCommand( String input, BookList books) { default: LOGGER.log(Level.WARNING, "Sorry but that is not a valid command. Please try again", command); - throw new UnsupportedCommandException("Sorry but this is not valid command," + - "use (help) to find out valid commands"); + throw new UnsupportedCommandException("Sorry but that is not a valid command. Please try again"); } } catch (NumberFormatException e) {