package tars.logic.commands;

import java.util.ArrayList;
import tars.model.task.TaskQuery;

/**
 * Finds and lists all tasks 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 tasks whose names contain any of "
            + "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
            + "Parameters: KEYWORD [MORE_KEYWORDS]...\n" + "Example: " + COMMAND_WORD + " CS2103 projects";

    private TaskQuery taskQuery = null;
    private ArrayList<String> lazySearchKeywords = null;
    private String searchKeywords = "";

    public FindCommand(TaskQuery taskQuery) {
        this.taskQuery = taskQuery;
    }

    public FindCommand(ArrayList<String> lazySearchKeywords) {
        this.lazySearchKeywords = lazySearchKeywords;
    }
    
    
    @Override
    public CommandResult execute() {
        if (taskQuery != null) {
            model.updateFilteredTaskListUsingFlags(taskQuery);
            searchKeywords = "\n" + taskQuery.toString();
        }

        if (lazySearchKeywords != null) {
            model.updateFilteredTaskListUsingLazySearch(lazySearchKeywords);
            searchKeywords = "\nQuick Search Keywords: " + lazySearchKeywords.toString();
        }
        return new CommandResult(
                getMessageForTaskListShownSummary(model.getFilteredTaskList().size()) + searchKeywords);
    }

}

package tars.logic.commands;

import java.util.ArrayList;
import tars.model.task.TaskQuery;

/**
 * Finds and lists all tasks 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 task based on the specified"
            + "keywords (case-insensitive) and displays them as a list with index numbers.\n"
            + "Parameters (Quick Search Mode): KEYWORD [MORE_KEYWORDS]...\n"
            + "Parameters (Filter Search Mode): -n NAME -dt DATETIME -p PRIORITY -t TAGS -do [or -ud] \n"
            + "Examples (Quick Serach Mode): " + COMMAND_WORD + " CS2103 projects" + "Examples (Filter Search Mode): "
            + COMMAND_WORD + " -n CS2103 projects -dt 10/09/2016 1000 to " + "20/09/2016 0100 -t school projects -do";

    private TaskQuery taskQuery = null;
    private ArrayList<String> lazySearchKeywords = null;
    private String searchKeywords = "";

    public FindCommand(TaskQuery taskQuery) {
        this.taskQuery = taskQuery;
    }

    public FindCommand(ArrayList<String> lazySearchKeywords) {
        this.lazySearchKeywords = lazySearchKeywords;
    }

    @Override
    public CommandResult execute() {
        if (taskQuery != null) {
            model.updateFilteredTaskListUsingFlags(taskQuery);
            searchKeywords = "\n" + taskQuery.toString();
        }

        if (lazySearchKeywords != null) {
            model.updateFilteredTaskListUsingLazySearch(lazySearchKeywords);
            searchKeywords = "\nQuick Search Keywords: " + lazySearchKeywords.toString();
        }
        return new CommandResult(
                getMessageForTaskListShownSummary(model.getFilteredTaskList().size()) + searchKeywords);
    }

}

Update Find Command MESSAGE_USAGE