Skip to content

Commit

Permalink
Merge pull request nus-cs2113-AY2324S2#40 from JeffinsonDarmawan/master
Browse files Browse the repository at this point in the history
Added more texts to the help command
  • Loading branch information
IanFH committed Mar 20, 2024
2 parents b79d690 + 5387bf5 commit cd9bf8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/main/java/florizz/core/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ private static RemoveFlowerCommand handleRemoveFlower(String argument) throws Fl
int prefixIndex = argument.indexOf(REMOVE_FLOWER_PREFIX);
int quantityIndex = argument.indexOf(QUANTITY);

String flowerName = argument.substring(0,quantityIndex).trim();
String flowerName = argument.substring(0, quantityIndex).trim();
String quantityString = removePrefix(argument.substring(quantityIndex, prefixIndex), QUANTITY).trim();
// [WARNING] might need to check if it's a valid integer
Integer quantity = Integer.parseInt(quantityString);
String bouquetName = removePrefix(argument.substring(prefixIndex), REMOVE_FLOWER_PREFIX).trim();

return new RemoveFlowerCommand(flowerName, quantity, bouquetName);

}
private static InfoCommand handleInfoCommand(String input) {
String flowerName = input.substring(input.indexOf(" ") + 1);
assert !flowerName.isEmpty() : "This string is empty";
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/florizz/core/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ public void printAllBouquets(ArrayList<Bouquet> bouquetList){
*/
public void printHelpMessage() {
System.out.println("Here are the list of commands you can use:");
System.out.println("1. new <bouquet_name> - Add a bouquet");
System.out.println("2. delete <bouquet_name> - Delete a bouquets");
System.out.println("1. new <bouquetName> - Add a bouquet");
System.out.println("2. delete <bouquetName> - Delete a bouquets");
System.out.println("3. mybouquets - List current saved bouquets");
System.out.println("4. info <flower_name> - Provide information on chosen flower");
System.out.println("5. flower - Shows a list of flowers that can be added into mybouquets");
System.out.println("6. flower <occasion> - Shows a list of flowers associated with said occasion");
System.out.println("7. bye - Exits the programme");
System.out.println("4. info <flowerName> - Provide information on chosen flower");
System.out.println("5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet.");
System.out.println("6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet.");
System.out.println("7. flower - Shows a list of flowers that can be added into mybouquets");
System.out.println("8. flower <occasion> - Shows a list of flowers associated with said occasion");
System.out.println("9. occasion - Shows a list of occasions associated with available flowers.");
System.out.println("10. bye - Exits the programme");
printBreakLine();
}

Expand Down

0 comments on commit cd9bf8c

Please sign in to comment.