package seedu.address.logic.parser;

import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEADLINE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import java.util.NoSuchElementException;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.logic.commands.AddCommand;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.IncorrectCommand;

/**
 * Parses input arguments and creates a new AddCommand object
 */
public class AddCommandParser {

    /**
     * Parses the given {@code String} of arguments in the context of the AddCommand
     * and returns an AddCommand object for execution.
     */
    public Command parse(String args) {
        ArgumentTokenizer argsTokenizer =
                new ArgumentTokenizer(PREFIX_DEADLINE, PREFIX_TAG);
        argsTokenizer.tokenize(args);
        try {
            return new AddCommand(
                    argsTokenizer.getPreamble().get(),
                    argsTokenizer.getValue(PREFIX_DEADLINE).get(),
                    ParserUtil.toSet(argsTokenizer.getAllValues(PREFIX_TAG))
            );
        } catch (NoSuchElementException nsee) {
            return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));
        } catch (IllegalValueException ive) {
            return new IncorrectCommand(ive.getMessage());
        }
    }

}

@@ -496,17 +496,16 @@
 ommand;%0A
-%0A
 /**%0A * P
@@ -955,13 +955,8 @@
     
-try %7B
 %0A   
@@ -964,54 +964,21 @@
     
-    return new AddCommand(%0A                   
+String name =
  arg
@@ -1003,25 +1003,25 @@
 mble().get()
-,
+;
 %0A           
@@ -1017,27 +1017,33 @@
         
-           
+String deadline =
  argsTok
@@ -1075,21 +1075,99 @@
 ADLINE).
-get()
+orElse(%22%22);%0A        %0A        try %7B%0A            return new AddCommand(name, deadline
 ,%0A      

Upgrade deadline implementation to optional