diff --git a/src/main/java/seedu/bookbuddy/BookBuddy.java b/src/main/java/seedu/bookbuddy/BookBuddy.java index 96e979602b..4208124464 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; import java.util.logging.Logger; @@ -40,6 +41,8 @@ public static void getUserInput(BookList books) { } catch (UnsupportedCommandException e) { LOGGER.log(Level.WARNING, "Unsupported command: {0}", userInput); 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 b19736da8f..84a72b538e 100644 --- a/src/main/java/seedu/bookbuddy/Parser.java +++ b/src/main/java/seedu/bookbuddy/Parser.java @@ -64,8 +64,10 @@ public static void parseCommand( String input, BookList books) { System.exit(0); break; default: + LOGGER.log(Level.WARNING, "Sorry but that is not a valid command. Please try again", command); throw new UnsupportedCommandException("Sorry but that is not a valid command. Please try again"); + } } catch (NumberFormatException e) { throw new InvalidBookIndexException("Book index must be an integer."); 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"); } }