package seedu.todolist.logic.commands;

import java.util.Set;

import seedu.todolist.logic.parser.CliSyntax;
import seedu.todolist.model.tag.UniqueTagList;


/**
 * Finds and lists all todos in address book whose name contains any of the argument keywords.
 * Keyword matching is case sensitive.
 */
public class FindCommand extends Command {

    public static final String COMMAND_WORD = "find";

    public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all todos whose names contain any of "
            + "the specified keywords (case-sensitive) and displays them as a list with index numbers.\n"
            + "To search by keyword: KEYWORD [MORE_KEYWORDS]...\n"
            + "To search by tag: " + CliSyntax.PREFIX_TAG + "TAG\n"
            + "Example: " + COMMAND_WORD + "groceries\n"
            + "Example2: " + COMMAND_WORD + CliSyntax.PREFIX_TAG + "milk\n";
    public static final String MESSAGE_EMPTY_ERROR = "Cannot leave fields blank.";

    private Set<String> keywords;
    private UniqueTagList tags;

    /**
     * Creates a FindCommand with keywords as parameters
     */
    public FindCommand(Set<String> keywords) {
        this.keywords = keywords;
    }

    //@@author A0163720M
    /**
     * Creates a FindCommand with tags as parameters
     *
     * @throws IllegalValueException if any of the raw values are invalid
     */
    public FindCommand(UniqueTagList tags) {
        this.tags = tags;
    }
    //@@author

    //@@author A0163720M
    @Override
    public CommandResult execute() {
        if (this.tags != null) {
            model.updateFilteredTodoList(tags);
        } else {
            model.updateFilteredTodoList(keywords);
        }

        return new CommandResult(getMessageForTodoListShownSummary(model.getFilteredTodoList().size()));
    }
    //@@author
}

@@ -649,34 +649,28 @@
 rd: 
-KEYWORD %5BMORE_KEYWORDS%5D...
+keyword_1 keyword_2 
 %5Cn%22%0A
@@ -730,15 +730,29 @@
 _TAG
- + %22TAG
+.getPrefix() + %22tag_1
 %5Cn%22%0A
@@ -795,16 +795,17 @@
 WORD + %22
+ 
 grocerie
@@ -852,16 +852,22 @@
 D_WORD +
+ %22 %22 +
  CliSynt
@@ -879,16 +879,28 @@
 EFIX_TAG
+.getPrefix()
  + %22milk

Update find command usage message