Skip to content

Commit

Permalink
Merge pull request #171
Browse files Browse the repository at this point in the history
Refactor add tag and delete tag command word
  • Loading branch information
CYX22222003 authored Oct 31, 2024
2 parents 553c7a0 + 594c4bb commit b892e8b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,22 @@ Examples:
* `list` followed by `delete 2` deletes the 2nd person in CampusConnect.
* `find n/Betsy` followed by `delete 1` deletes the 1st person in the results of the `find` command.

### Deleting a person's tag : `deletetag`
### Deleting a person's tag : `deltag`

Deletes the specified person's tag.

Format: `deletetag INDEX t/KEYWORD`
Format: `deltag INDEX t/KEYWORD`

* Deletes the tag with the specified name `KEYWORD` of 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, …​
* Only one tag can be deleted at a time.

Examples:
* `deletetag 1 t/friend` deletes the friend tag of the first person in the list.
* `deltag 1 t/friend` deletes the friend tag of the first person in the list.

Disallowed examples:
* `deletetag 2 t/classmate t/neighbour` will not succeed as it tries to delete 2 tags at once.
* `deltag 2 t/classmate t/neighbour` will not succeed as it tries to delete 2 tags at once.

### Undo a command : `undo`

Expand Down Expand Up @@ -253,7 +253,7 @@ Action | Format, Examples
**Find by email** | `find e/KEYWORD [MORE_KEYWORDS]`<br> e.g., `find e/bigman123@email.com bobbyrick@example.com`
**Find by phone number** | `find p/KEYWORD [MORE_KEYWORDS]`<br> e.g., `find p/91234657 85432789`
**Find by tag** | `find t/KEYWORD [MORE_KEYWORDS]`<br> e.g., `find t/friend roommate`
**Delete tag** | `deletetag INDEX t/KEYWORD` <br> e.g. `deletetag 1 t/friend`
**Delete tag** | `deltag INDEX t/KEYWORD` <br> e.g. `deltag 1 t/friend`
**Undo action** | `undo`
**Redo action** | `redo`
**List** | `list`
Expand Down
4 changes: 2 additions & 2 deletions docs/diagrams/AddTagSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("addTag 2 t/mate")
[-> LogicManager : execute("addtag 2 t/mate")
activate LogicManager

LogicManager -> CampusConnectParser : parseCommand("addTag 2 t/mate")
LogicManager -> CampusConnectParser : parseCommand("addtag 2 t/mate")
activate CampusConnectParser

create AddTagCommandParser
Expand Down
4 changes: 2 additions & 2 deletions docs/diagrams/DeleteTagSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("deletetag 1 t/test")
[-> LogicManager : execute("deltag 1 t/test")
activate LogicManager

LogicManager -> CampusConnectParser : parseCommand("deletetag 1 t/test")
LogicManager -> CampusConnectParser : parseCommand("deltag 1 t/test")
activate CampusConnectParser

create DeleteTagCommandParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Add new tag(s) for an existing person
*/
public class AddTagCommand extends Command {
public static final String COMMAND_WORD = "addTag";
public static final String COMMAND_WORD = "addtag";

public static final String MESSAGE_USAGE = COMMAND_WORD + "Add tag(s) for the person identified "
+ "by the index number used in the displayed person list "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

/**
* Implements command to delete a tag from a person
* format: deletetag [INDEX] t/[TAG NAME]
* format: deltag [INDEX] t/[TAG NAME]
*/
public class DeleteTagCommand extends Command {
public static final String COMMAND_WORD = "deletetag";
public static final String COMMAND_WORD = "deltag";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes tag from the person identified by the index number used in the displayed person list.\n"
Expand Down

0 comments on commit b892e8b

Please sign in to comment.