package seedu.address.logic.commands;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.UnmodifiableObservableList;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.task.ReadOnlyTask;
import seedu.address.model.task.UniqueTaskList.TaskNotFoundException;

/**
 * Deletes a person identified using it's last displayed index from the address book.
 */
public class DeleteCommand extends Command {

    public static final String COMMAND_WORD = "delete";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Deletes the person identified by the index number used in the last person listing.\n"
            + "Parameters: INDEX (must be a positive integer)\n"
            + "Example: " + COMMAND_WORD + " 1";

    public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted Person: %1$s";

    public final int targetIndex;

    public DeleteCommand(int targetIndex) {
        this.targetIndex = targetIndex;
    }


    @Override
    public CommandResult execute() throws CommandException {

        UnmodifiableObservableList<ReadOnlyTask> lastShownList = model.getFilteredPersonList();

        if (lastShownList.size() < targetIndex) {
            throw new CommandException(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
        }

        ReadOnlyTask personToDelete = lastShownList.get(targetIndex - 1);

        try {
            model.deletePerson(personToDelete);
        } catch (TaskNotFoundException pnfe) {
            assert false : "The target person cannot be missing";
        }

        return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, personToDelete));
    }

}

@@ -337,22 +337,20 @@
 letes a 
-person
+task
  identif
@@ -604,22 +604,20 @@
 tes the 
-person
+task
  identif
@@ -657,22 +657,20 @@
 he last 
-person
+task
  listing
@@ -861,22 +861,20 @@
 Deleted 
-Person
+Task
 : %251$s%22;
@@ -1346,30 +1346,28 @@
 nlyTask 
-person
+task
 ToDelete
  = lastS
@@ -1358,17 +1358,16 @@
 ToDelete
- 
 = lastSh
@@ -1442,22 +1442,20 @@
 ePerson(
-person
+task
 ToDelete
@@ -1543,22 +1543,20 @@
  target 
-person
+task
  cannot 
@@ -1661,14 +1661,12 @@
 SS, 
-person
+task
 ToDe

Rename person to task in DeleteCommand