Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into escape-field
Browse files Browse the repository at this point in the history
  • Loading branch information
E0735389 committed Apr 4, 2024
2 parents 29dc40f + 02297d3 commit c66b6a7
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 55 deletions.
76 changes: 41 additions & 35 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ To close the help window, you can simply press `esc` on your keyboard. Windows u

The [project website](https://ay2324s2-cs2103t-t11-2.github.io/tp/) includes the NUSContacts user guide, which contains a more detailed description of each command.

#### Adding a person: `add`
#### Adding a contact: `add`

Adds a person to the address book.
Adds a contact to the address book.

Format: `add n/NAME e/EMAIL r/ROLE c/COURSE [a/ADDRESS] [p/PHONE] [t/TAG]… [f/]`

<div markdown="span" class="alert alert-primary">:bulb: **Tip:**
A person can have any number of tags (including 0).
A contact can have any number of tags (including 0).
</div>

Examples:
Expand Down Expand Up @@ -143,35 +143,35 @@ This is mostly sufficient for you to know how to use the command. Here are some
Note that `f/` must come at the end, or immediately before a tag. For example, `add f/ n/Alice …` is allowed, but `add
n/ f/ Alice …` is not allowed.

#### Editing a person: `edit`
#### Editing a contact: `edit`

Edits an existing person in the address book.
Edits an existing contact in the address book.

Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [r/ROLE] [a/ADDRESS] [c/COURSE] [t/TAG]… [f/]`

* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index **must be a positive integer** 1, 2, 3, …
* Edits the contact at the specified `INDEX`. The index refers to the index number shown in the displayed address book. The index **must be a positive integer** 1, 2, 3, …
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.
* When editing tags, the existing tags of the person will be removed i.e. adding of tags is not cumulative.
* You can remove all the person’s tags by typing `t/` without
* When editing tags, the existing tags of the contact will be removed i.e. adding of tags is not cumulative.
* You can remove all the contact’s tags by typing `t/` without
specifying any tags after it.
* You can remove a person's phone number by typing `p/` without specifying any phone number after it.
* You can remove a contact's phone number by typing `p/` without specifying any phone number after it.

Examples:
* `edit 1 p/91234567 e/[email protected]` Edits the phone number and email address of the 1st person to be `91234567` and `[email protected]` respectively.
* `edit 2 n/Betsy Crower t/` Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags.
* `edit 3 p/ t/` Deletes the phone number of the 3rd person and clears all existing tags.
* `edit 1 p/91234567 e/[email protected]` Edits the phone number and email address of the 1st contact to be `91234567` and `[email protected]` respectively.
* `edit 2 n/Betsy Crower t/` Edits the name of the 2nd contact to be `Betsy Crower` and clears all existing tags.
* `edit 3 p/ t/` Deletes the phone number of the 3rd contact and clears all existing tags.

<div markdown="block" class="alert alert-info">
:bulb: If an invalid field value is specified, the program will inform you of the error.
You can fix the error, or use `f/` to bypass it if you want to.

Refer to [Adding a person: `add`](#adding-a-person-add) for more information about `f/`.
Refer to [Adding a contact: `add`](#adding-a-contact-add) for more information about `f/`.
</div>

#### Locating persons by name: `find`
#### Locating contacts by name: `find`

Finds persons whose names or course contain any of the given keywords.
Finds contacts whose names or course contain any of the given keywords.

Format: `find KEYWORD [MORE_KEYWORDS]`

Expand All @@ -183,7 +183,7 @@ Format: `find KEYWORD [MORE_KEYWORDS]`
e.g. `Han` will not match `Hans`.
e.g. `cs2103` will not match `CS2103T`.
e.g. `stu` will not match `STUDENT`.
* Persons matching at least one keyword will be returned (i.e. `OR` search).
* Contacts matching at least one keyword will be returned (i.e. `OR` search).
e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang`.
e.g. `Hans CS2103T` will return `Hans Gruber`, `Bo Yang` whose course is CS2103T.
e.g. `Hans TA` will return `Hans Gruber`, `Bo Yang` whose role is TA.
Expand All @@ -204,33 +204,33 @@ Examples:
##### Note on returning to the original view
* After using `find`, the list may no longer display all saved contacts. Use `list` to revert the list to the full list of contacts in the order they were added.

#### Listing all persons: `list`
#### Listing all contacts: `list`

Shows a list of all persons in the address book.
Shows a list of all contacts in the address book.

Format: `list`

<div markdown="block" class="alert alert-info">
:bulb: See [note](#note-on-returning-to-the-original-view) under [Locating Persons by Name](#locating-persons-by-name-find) to understand how the `list` command can be useful.
:bulb: See [note](#note-on-returning-to-the-original-view) under [Locating Contacts by Name](#locating-contacts-by-name-find) to understand how the `list` command can be useful.
</div>


#### Deleting a person: `delete`
#### Deleting a contact: `delete`

Deletes the specified person(s) from the address book.
Deletes the specified contact(s) from the address book.

Format: `delete INDEX`

* Deletes the person at the specified `INDEX`.
* The index refers to the index number shown in the displayed person list.
* Deletes the contact at the specified `INDEX`.
* The index refers to the index number shown in the displayed address book.
* The index **must be a positive integer** 1, 2, 3, …

Examples:
* `list` followed by `delete 2` deletes the 2nd person in the address book.
* `find Betsy` followed by `delete 1` deletes the 1st person in the results of the `find` command.
* `list` followed by `delete 2` deletes the 2nd contact in the address book.
* `find Betsy` followed by `delete 1` deletes the 1st contact in the results of the `find` command.


You can also delete multiple people by chaining the indices using a comma.
You can also delete multiple contacts by chaining the indices using a comma.

Format: `delete INDEX1, INDEX2, INDEX3, …`

Expand All @@ -240,21 +240,21 @@ Format: `delete INDEX1, INDEX2, INDEX3, …`
* Each `INDEX` must still adhere to the points listed above.

Example:
* `delete 3, 1, 7, 8` deletes the first, third, seventh, and eighth person in the address book.
* `delete 3, 1, 7, 8` deletes the first, third, seventh, and eighth contact in the address book.

#### Copying a person's email to clipboard: `copy`
#### Copying a contact's email to clipboard: `copy`

Copies the email of the specified person from the address book to the system clipboard.
Copies the email of the specified contact from the address book to the system clipboard.

Format: `copy INDEX`

* Copies the email of the person at the specified `INDEX`.
* The index refers to the index number shown in the displayed person list.
* Copies the email of the contact at the specified `INDEX`.
* The index refers to the index number shown in the displayed address book.
* The index **must be a positive integer** 1, 2, 3, …

Examples:
* `list` followed by `copy 2` copies the email of the 2nd person in the address book to the clipboard.
* `find Betsy` followed by `copy 1` copies the email of the 1st person in the results of the `find` command to the clipboard.
* `list` followed by `copy 2` copies the email of the 2nd contact in the address book to the clipboard.
* `find Betsy` followed by `copy 1` copies the email of the 1st contact in the results of the `find` command to the clipboard.

#### Clearing all entries: `clear`

Expand All @@ -264,15 +264,21 @@ Format: `clear`

#### Undo last command : `undo`

Revert the last change to the contact list.
Revert the last change to the address book.

Since you can only undo the most recent change, entering `undo` consecutively
will only show an error message (`No new changes has been made to the data`).
Likewise, entering `undo` with no prior changes will also display the same error message.

**Note:** `undo` does not affect commands that do not modify the contact list
**Note:** `undo` does not affect commands that do not modify the address book
(`help`, `list`, `find` etc.).

<div markdown="span" class="alert alert-primary">:bulb: **Tip:**
While it's not possible to redo (undo an undo), you can use the [command history](#command-history) feature,
press `UP` a few times to go to the command that executes the edit,
then press `ENTER` to execute it.
</div>

#### Exiting the program: `exit`

Exits the program.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public class Messages {
public static final String MESSAGE_FORCE_TAG_MUST_BE_EMPTY = "There must be no value following " + PREFIX_FORCE;
public static final String MESSAGE_UNEXPECTED_ARGUMENT = "Invalid command format!\n"
+ "Command '%1$s' should not take any arguments";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The contact index provided is invalid";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX_WITH_USAGE =
"The person index provided is invalid\n%1$s";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
"The contact index provided is invalid\n%1$s";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d contact(s) listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
public static final String MESSAGE_FIX_OR_ADD_FORCE_FLAG =
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AddCommand extends Command {

public static final String COMMAND_WORD = "add";

public static final String COMMAND_DESCRIPTION = COMMAND_WORD + ": Adds a person to the address book.\n";
public static final String COMMAND_DESCRIPTION = COMMAND_WORD + ": Adds a contact to the address book.\n";

public static final String MESSAGE_USAGE = COMMAND_DESCRIPTION
+ "Parameters: "
Expand All @@ -45,8 +45,8 @@ public class AddCommand extends Command {
+ PREFIX_TAG + "friends "
+ PREFIX_TAG + "owesMoney";

public static final String MESSAGE_SUCCESS = "New person added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book";
public static final String MESSAGE_SUCCESS = "New contact added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This contact already exists in the address book";

private final Person toAdd;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CopyCommand extends Command {

public static final String COMMAND_WORD = "copy";
public static final String COMMAND_DESCRIPTION = COMMAND_WORD
+ ": Copies the email of the person identified by the index number used in the displayed person list.\n";
+ ": Copies the email of the contact identified by the index number used in the displayed address book.\n";

public static final String MESSAGE_USAGE = COMMAND_DESCRIPTION
+ "Parameters: INDEX (must be a positive integer)\n"
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/logic/commands/DeleteCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public class DeleteCommand extends Command {
public static final String COMMAND_WORD = "delete";

public static final String COMMAND_DESCRIPTION = COMMAND_WORD
+ ": Deletes the person(s) identified by the index number(s) used in the displayed person list.\n";
+ ": Deletes the contact(s) identified by the index number(s) used in the displayed address book.\n";

public static final String MESSAGE_USAGE = COMMAND_DESCRIPTION
+ "Parameters (for one person): INDEX\n"
+ "Parameters (for multiple people): INDEX1, INDEX2, ...\n"
+ "Parameters (for one contact): INDEX\n"
+ "Parameters (for multiple contacts): INDEX1, INDEX2, ...\n"
+ "Example: " + COMMAND_WORD + " 1, 2, 3";

public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted Person(s): \n%1$s";
public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted contact(s): \n%1$s";

private final List<Index> targetIndexList;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class EditCommand extends Command {

public static final String COMMAND_WORD = "edit";

public static final String COMMAND_DESCRIPTION = COMMAND_WORD + ": Edits the details of the person identified "
+ "by the index number used in the displayed person list. "
public static final String COMMAND_DESCRIPTION = COMMAND_WORD + ": Edits the details of the contact identified "
+ "by the index number used in the displayed address book. "
+ "Existing values will be overwritten by the input values.\n";

public static final String MESSAGE_USAGE = COMMAND_DESCRIPTION
Expand All @@ -59,9 +59,9 @@ public class EditCommand extends Command {
+ PREFIX_PHONE + "91234567 "
+ PREFIX_EMAIL + "[email protected]";

public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s";
public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Contact: %1$s";
public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided.";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book.";
public static final String MESSAGE_DUPLICATE_PERSON = "This contact already exists in the address book.";

private final Index index;
private final EditPersonDescriptor editPersonDescriptor;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import seedu.address.model.person.RoleContainsKeywordsPredicate;

/**
* Finds and lists all persons in address book whose name, course, or role contains any of the argument keywords.
* Finds and lists all people in address book whose name, course, or role contains any of the argument keywords.
* Keyword matching is case insensitive.
*/
public class FindCommand extends Command {

public static final String COMMAND_WORD = "find";
public static final String COMMAND_DESCRIPTION = COMMAND_WORD
+ ": Finds all persons whose name, course, or role contains any of "
+ ": Finds all contacts whose name, course, or role contains any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n";

public static final String MESSAGE_USAGE = COMMAND_DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/ListCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class ListCommand extends Command {

public static final String COMMAND_WORD = "list";

public static final String MESSAGE_SUCCESS = "Listed all persons";
public static final String MESSAGE_SUCCESS = "Listed all contacts.";

public static final String COMMAND_DESCRIPTION = COMMAND_WORD
+ ": Shows a list of all persons in the address book.\n";
+ ": Shows a list of all contacts in the address book.\n";

@Override
public CommandResult execute(Model model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UndoCommand extends Command {
public static final String COMMAND_WORD = "undo";

public static final String COMMAND_DESCRIPTION = COMMAND_WORD
+ ": Undo the changes (if any) made by the previous command execution.\n";
+ ": Undoes the changes (if any) made by the previous command execution.\n";

public static final String MESSAGE_SUCCESS = "Successfully revert the changes.";

Expand Down

0 comments on commit c66b6a7

Please sign in to comment.