package seedu.ezdo.logic.commands;

import seedu.ezdo.logic.commands.exceptions.CommandException;

/*
 * Undo the last undoable command.
 */
public class UndoCommand extends Command {
    public static final String COMMAND_WORD = "undo";

    public static final String MESSAGE_USAGE = COMMAND_WORD + ": Undo the previous undoable command.";
    public static final String MESSAGE_SUCCESS = "Previous undoable command has been undone!";
    public static final String MESSAGE_NO_PREV_COMMAND = "There is no previous undoable command!";

    @Override
    public CommandResult execute() throws CommandException {

        return null;
    }

}

@@ -29,16 +29,55 @@
 mands;%0A%0A
+import java.util.EmptyStackException;%0A%0A
 import s
@@ -648,29 +648,221 @@
 n %7B%0A
-%0A        return null;
+        try %7B%0A            model.undo();%0A            return new CommandResult(MESSAGE_SUCCESS);%0A        %7D catch (EmptyStackException ese) %7B%0A            throw new CommandException(MESSAGE_NO_PREV_COMMAND);%0A        %7D
 %0A   

Implement UndoCommand's execute