package seedu.taskboss.logic.parser;

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

import java.util.HashSet;
import java.util.Set;

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);

        return new DeleteCommand(index);
    }

    private Set<Integer> parseIndex(String indexList) {
        Set<Integer> taskIndex = new HashSet<Integer>();
        String trimmedList = indexList.trim();
        String[] indexes = trimmedList.split(" ");

        if(trimmedList.isEmpty()) {
            return new IncorrectCommand(
                String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE));
        }    

        for (String index : indexes) {
            taskIndex.add(Integer.parseInt(index));
        }

        return taskIndex;
    }
}

@@ -629,16 +629,211 @@
 args) %7B%0A
+        %0A        if (args.isEmpty()) %7B%0A            return new IncorrectCommand(%0A                    String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE));%0A        %7D%0A        
 %0A       
@@ -872,16 +872,24 @@
 (args);%0A
+        
 %0A       
@@ -1143,191 +1143,8 @@
  %22);
-%0A%0A        if(trimmedList.isEmpty()) %7B%0A            return new IncorrectCommand(%0A                String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE));%0A        %7D  
   %0A%0A

Update DeleteCommandParser.java