package seedu.doist.logic.commands;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import seedu.doist.commons.exceptions.IllegalValueException;
import seedu.doist.logic.commands.exceptions.CommandException;
import seedu.doist.model.tag.Tag;
import seedu.doist.model.tag.UniqueTagList;
import seedu.doist.model.task.Description;
import seedu.doist.model.task.Task;
import seedu.doist.model.task.UniqueTaskList;

/**
 * Adds a person to the address book.
 */
public class AddCommand extends Command {

    public static ArrayList<String> commandWords = new ArrayList<>(Arrays.asList("add", "do"));
    public static final String DEFAULT_COMMAND_WORD = "add";

    public static final String MESSAGE_USAGE = getUsageTextForCommandWords() + ": Adds a person to the address book. "
            + "Parameters: NAME p/PHONE e/EMAIL a/ADDRESS  [t/TAG]...\n" + "Example: " + DEFAULT_COMMAND_WORD
            + " John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney";

    public static final String MESSAGE_SUCCESS = "New task added: %1$s";
    public static final String MESSAGE_DUPLICATE_PERSON = "This task already exists in the to-do list";

    private final Task toAdd;

    /**
     * Creates an AddCommand using raw values.
     *
     * @throws IllegalValueException
     *             if any of the raw values are invalid
     */
    public AddCommand(String name, Set<String> tags) throws IllegalValueException {
        final Set<Tag> tagSet = new HashSet<>();
        for (String tagName : tags) {
            tagSet.add(new Tag(tagName));
        }
        this.toAdd = new Task(new Description(name), new UniqueTagList(tagSet));
    }

    @Override
    public CommandResult execute() throws CommandException {
        assert model != null;
        try {
            model.addTask(toAdd);
            return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
        } catch (UniqueTaskList.DuplicateTaskException e) {
            throw new CommandException(MESSAGE_DUPLICATE_PERSON);
        }
    }

    /**
     * @return a string containing all the command words to be shown in the
     *         usage message, in the format of (word1|word2|...)
     */
    protected static String getUsageTextForCommandWords() {
        StringBuilder sb = new StringBuilder();
        sb.append("(");
        if (!commandWords.contains(DEFAULT_COMMAND_WORD)) {
            sb.append(DEFAULT_COMMAND_WORD + "|");
        }
        for (String commandWord : commandWords) {
            sb.append(commandWord + "|");
        }
        sb.setCharAt(sb.length() - 1, ')');
        return sb.toString();
    }

    public static boolean canCommandBeTriggeredByWord(String word) {
        return commandWords.contains(word) || DEFAULT_COMMAND_WORD.equals(word);
    }
}

@@ -800,35 +800,21 @@
 s a 
-person to the address book.
+task to Doist
  %22%0A 
@@ -843,53 +843,108 @@
 rs: 
-NAME p/PHONE e/EMAIL a/ADDRESS  %5Bt/
+TASK_DESCRIPTION  %5B%5C%5Cfrom START_TIME%5D %5B%5C%5Cto END_TIME%5D %5B%5C%5Cas PRIORITY%5D %5B%5C%5Cunder 
 TAG
-%5D
 ...
-%5Cn%22
+%5D%22 %0A           
  + %22
@@ -980,114 +980,78 @@
 WORD
-%0A            + %22 John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney
+ + %22Group meeting %5C%5Cfrom 1600 %5C%5Cto 1800 %5C%5Cas IMPORTANT %5C%5Cunder school 
 %22;%0A%0A
@@ -1448,23 +1448,16 @@
 and(
-String name, Se
+ArrayLis
 t%3CSt
@@ -1462,19 +1462,24 @@
 String%3E 
-tag
+argument
 s) throw
@@ -1516,86 +1516,100 @@
     
-final Set%3CTag%3E tagSet = new HashSet%3C%3E();%0A        for (String tagName : tags) %7B
+if(arguments.isEmpty())%7B%0A            throw new IllegalValueException(%22No arguments passed%22);
 %0A   
@@ -1617,39 +1617,56 @@
     
+%7D%0A
     
-tagSet.add(new Tag(tagName)
+    final Set%3CTag%3E tagSet = new HashSet%3C%3E(
 );%0A 
@@ -1664,33 +1664,32 @@
 et%3C%3E();%0A        
-%7D
 %0A        this.to
@@ -1723,12 +1723,24 @@
 ion(
-name
+arguments.get(0)
 ), n

Edit class to implement own parser