//@@author A0138474X
package seedu.address.logic.parser;

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

import java.util.Optional;

import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.DeleteCommand;
import seedu.address.logic.commands.IncorrectCommand;

/**
 * Parses input arguments and creates a new DeleteCommand object
 */
public class DeleteCommandParser {

    /**
     * Parses the given {@code String} of arguments in the context of the DeleteCommand
     * and returns an DeleteCommand object for execution.
     */
    public static Command parse(String args) {
        ArgumentTokenizer argsTokenizer = new ArgumentTokenizer(PREFIX_ALL);
        argsTokenizer.tokenize(args);

        String stringIndex = argsTokenizer.getPreamble().get();
        Optional<Integer> index = ParserUtil.parseIndex(stringIndex);
        Optional<String> isDeleteAll = argsTokenizer.getValue(PREFIX_ALL);
        if (!index.isPresent()) {
            return new IncorrectCommand(
                    String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE));
        }

        return new DeleteCommand(index.get(), isDeleteAll.isPresent());
    }

}

@@ -810,16 +810,220 @@
 args);%0A%0A
+        if (!argsTokenizer.getPreamble().isPresent()) %7B%0A            return new IncorrectCommand(%0A                    String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE));%0A        %7D%0A
         

Update deleteCommandParser to pass the test