package seedu.taskboss.logic.parser;

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

import java.util.Optional;

import seedu.taskboss.logic.commands.Command;
import seedu.taskboss.logic.commands.DeleteCommand;
import seedu.taskboss.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 Command parse(String args) {
        
        Set<Integer> index = parseIndex(args);

        if (!index.isPresent()) {
            return new IncorrectCommand(
                    String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE));
        }

        return new DeleteCommand(index.get());
    }
    
    public static String[] parseIndex(String indexList) {
        String trimmedList = indexList.trim();
        String[] indexes = trimmedList.split(" ");
        
        return indexes;
    }

}

@@ -141,16 +141,38 @@
 ptional;
+%0Aimport java.util.Set;
 %0A%0Aimport
@@ -630,25 +630,17 @@
 args) %7B%0A
-        
 %0A
+
         
@@ -915,21 +915,17 @@
 ;%0A    %7D%0A
-    
 %0A
+
     publ
@@ -1076,17 +1076,9 @@
 %22);%0A
-        
 %0A
+
     
@@ -1097,17 +1097,16 @@
 ndexes;%0A
+
     %7D%0A
-%0A
 %7D%0A

Update DeleteCommandParser.java