Skip to content

Commit

Permalink
Merge pull request nus-cs2113-AY2324S2#24 from liuzehui03/help_feature
Browse files Browse the repository at this point in the history
Help feature
  • Loading branch information
liuzehui03 authored Mar 20, 2024
2 parents d8f1663 + 7d7b4e3 commit 96ac344
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/seedu/bookbuddy/BookBuddy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package seedu.bookbuddy;

import exceptions.InvalidCommandArgumentException;
import exceptions.UnsupportedCommandException;
import java.util.Scanner;
import java.util.logging.Logger;
Expand Down Expand Up @@ -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());
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/bookbuddy/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/seedu/bookbuddy/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

0 comments on commit 96ac344

Please sign in to comment.