Skip to content

Commit

Permalink
Update command outputs to fit command box and display correct help fo…
Browse files Browse the repository at this point in the history
…rmat
  • Loading branch information
NatLeong committed Apr 1, 2024
1 parent 2ec17dc commit ed8d3b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/CreateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public class CreateCommand extends Command {
+ PREFIX_SYMPTOM + "SYMPTOM "
+ PREFIX_DIAGNOSIS + "DIAGNOSIS "
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NRIC + "S1234567A "
+ PREFIX_NRIC + "S0123456A "
+ PREFIX_NAME + "John Doe "
+ PREFIX_PHONE + "98765432 "
+ PREFIX_EMAIL + "[email protected] "
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 "
+ PREFIX_DATEOFBIRTH + "01-01-1990 "
+ PREFIX_DATEOFBIRTH + "1990-01-01 "
+ PREFIX_SEX + "M "
+ PREFIX_STATUS + "PENDING "
+ PREFIX_TAG + "Long term medication "
Expand Down Expand Up @@ -79,7 +79,7 @@ public CommandResult execute(Model model) throws CommandException {
}

model.addPerson(toAdd);
return new CommandResult(String.format(MESSAGE_SUCCESS, Messages.format(toAdd)));
return new CommandResult(String.format(MESSAGE_SUCCESS, Messages.formatRead(toAdd)));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CommandResult execute(Model model) throws CommandException {
//second checks if the NRIC is in the list
Person personToDelete = persons.filtered(person -> person.getNric().equals(targetNric)).get(0);
model.deletePerson(personToDelete);
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.format(personToDelete)));
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.formatRead(personToDelete)));
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/logic/commands/UpdateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public class UpdateCommand extends Command {
public static final String COMMAND_WORD = "update";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Updates the details of the person identified "
+ "by the index number used in the displayed person list. "
+ "by the NRIC. "
+ "Existing values will be overwritten by the input values.\n"
+ "Parameters: INDEX (must be a positive integer) "
+ "Parameters: NRIC "
+ "[" + PREFIX_NAME + "NAME] "
+ "[" + PREFIX_PHONE + "PHONE] "
+ "[" + PREFIX_EMAIL + "EMAIL] "
+ "[" + PREFIX_ADDRESS + "ADDRESS] "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ "Example: " + COMMAND_WORD + " S1234567A "
+ PREFIX_PHONE + "91234567 "
+ PREFIX_EMAIL + "[email protected]";

Expand Down Expand Up @@ -98,7 +98,7 @@ public CommandResult execute(Model model) throws CommandException {

model.setPerson(personToUpdate, updatedPerson);
model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);
return new CommandResult(String.format(MESSAGE_UPDATE_PERSON_SUCCESS, Messages.format(updatedPerson)));
return new CommandResult(String.format(MESSAGE_UPDATE_PERSON_SUCCESS, Messages.formatRead(updatedPerson)));
}

/**
Expand Down

0 comments on commit ed8d3b1

Please sign in to comment.