Skip to content

Commit

Permalink
Merge pull request AY2425S1-CS2103T-F14a-4#200
Browse files Browse the repository at this point in the history
Standardize error messages across commands
  • Loading branch information
CYX22222003 authored Nov 3, 2024
2 parents 99dde99 + 64342da commit d5d653b
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 546 deletions.
9 changes: 5 additions & 4 deletions src/main/java/seedu/address/logic/commands/AddTagCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
public class AddTagCommand extends Command {
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 "
+ "Parameters: INDEX (must be a positive interger) "
+ "[" + PREFIX_TAG + "TAG]...\n";
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\n"
+ "Parameters: INDEX (must be a positive integer) "
+ PREFIX_TAG + "TAG [" + PREFIX_TAG + "MORE_TAGS]...\n"
+ "Example: " + COMMAND_WORD + " 1 " + PREFIX_TAG + "friend " + PREFIX_TAG + "owesMoney";

public static final String MESSAGE_ADD_TAG_SUCCESS = "Tag added: %1$s";
public static final String MESSAGE_NOT_ADD = "At least one tag to be provided.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class DeleteTagCommand extends Command {

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"
+ "Parameters: INDEX (must be a positive integer) [TAG NAME]\n"
+ "Example: " + COMMAND_WORD + " 1 " + " hello_world";
+ "Parameters: INDEX (must be a positive integer) t/TAG\n"
+ "Example: " + COMMAND_WORD + " 1 " + "t/hello_world";

private final Index targetIndex;
private final Tag targetTag;
Expand Down
36 changes: 0 additions & 36 deletions src/main/java/seedu/address/logic/commands/FindByEmailCommand.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/seedu/address/logic/commands/FindByNameCommand.java

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/java/seedu/address/logic/commands/FindByPhoneCommand.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/seedu/address/logic/commands/FindByTagCommand.java

This file was deleted.

20 changes: 9 additions & 11 deletions src/main/java/seedu/address/logic/commands/SuperFindCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
Expand All @@ -13,20 +17,14 @@
public class SuperFindCommand extends Command {

public static final String COMMAND_WORD = "find";
public static final String NAME_COMMAND_WORD = " n/";
public static final String EMAIL_COMMAND_WORD = " e/";
public static final String PHONE_COMMAND_WORD = " p/";
public static final String TAG_COMMAND_WORD = " t/";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all persons whose names, phone numbers, emails "
+ "or tags contain any of the specified keywords (case-insensitive) and displays"
+ "or tags contain any of the specified keywords (case-insensitive) and displays "
+ "them as a list with indices.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example:\n"
+ COMMAND_WORD + NAME_COMMAND_WORD + "alice bob charlie\n"
+ COMMAND_WORD + EMAIL_COMMAND_WORD + "[email protected]\n"
+ COMMAND_WORD + PHONE_COMMAND_WORD + "12345678\n"
+ COMMAND_WORD + TAG_COMMAND_WORD + "CS2100_classmate\n";
+ "Parameters: PREFIX/KEYWORD [PREFIX/MORE_KEYWORDS]...\n"
+ "Examples:\n"
+ COMMAND_WORD + " " + PREFIX_NAME + "alice " + PREFIX_PHONE + "80021234 " + PREFIX_TAG + "CS1101S\n"
+ COMMAND_WORD + " " + PREFIX_EMAIL + "[email protected] " + PREFIX_EMAIL + "[email protected]";

public static final String MESSAGE_NO_PERSONS_FOUND = "No persons found!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public class AddTagCommandParser implements Parser<AddTagCommand> {
*/
public AddTagCommand parse(String args) throws ParseException {
requireNonNull(args);
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_TAG);
ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_TAG);

Index index;

Expand Down

This file was deleted.

Loading

0 comments on commit d5d653b

Please sign in to comment.