package seedu.doit.logic.parser;

import static seedu.doit.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import seedu.doit.logic.commands.Command;
import seedu.doit.logic.commands.IncorrectCommand;
import seedu.doit.logic.commands.SortCommand;

/**
 * Parses input arguments and creates a new SortCommand object
 */
public class SortCommandParser {
    public static final String SORT_VALIDATION_REGEX = "(priority)|(deadline)|(start time)|(name)";

    /**
     * Parses the given {@code String} of arguments in the context of the FindCommand
     * and returns an FindCommand object for execution.
     */
    public Command parse(String args) {
        if (args.trim().matches(SORT_VALIDATION_REGEX)) {
            return new SortCommand(args.trim());
        } else {
            return new IncorrectCommand(
                String.format(MESSAGE_INVALID_COMMAND_FORMAT, SortCommand.MESSAGE_USAGE));
        }
    }
}

@@ -356,21 +356,22 @@
  %7B%0A    p
-ublic
+rivate
  static 
@@ -452,17 +452,16 @@
 name)%22;%0A
-%0A
     /**%0A

Make sort regex private