package seedu.tasklist.logic.parser;

import static seedu.tasklist.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.tasklist.logic.parser.CliSyntax.KEYWORDS_ARGS_FORMAT;

import java.util.regex.Matcher;

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

/**
 * Parses input arguments and creates a new SortCommand object
 */
public class SortCommandParser {

    /**
     * Parses the given {@code String} of arguments in the context of the SortCommand
     * and returns an SortCommand object for execution.
     */
    public Command parse(String args) {

        final Matcher matcher = KEYWORDS_ARGS_FORMAT.matcher(args.trim());
        if (!matcher.matches()) {
            return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, SortCommand.MESSAGE_USAGE));
        }
        final String keyword = matcher.group("keywords");
        return new SortCommand(keyword);
    }


}


@@ -189,16 +189,89 @@
 ORMAT;%0A%0A
+import java.util.Arrays;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A
 import j
@@ -985,16 +985,25 @@
       %7D%0A
+        %0A
         
@@ -1018,16 +1018,18 @@
 ring
+%5B%5D
  keyword
  = m
@@ -1024,16 +1024,17 @@
  keyword
+s
  = match
@@ -1053,16 +1053,103 @@
 ywords%22)
+.split(%22 %22);%0A        final Set%3CString%3E keyword = new HashSet%3C%3E(Arrays.asList(keywords))
 ;%0A      

Update SortCommandParser.java