package seedu.taskboss.logic.commands;

import java.util.EmptyStackException;

/**
 * Undoes the most recent operation entered by user.
 */
 
public class UndoCommand extends Command {
	
    public static final String COMMAND_WORD = "undo";
    
    public static final String MESSAGE_USAGE = COMMAND_WORD
    		+ ": Undoes the most recent operation entered by user\n"
    		+ "Example: " + COMMAND_WORD;
    
    public static final String MESSAGE_SUCCESS = "The most recent operation has been undone!";
    
    public static final String MESSAGE_WITHOUT_PREVIOUS_OPERATION = "Cannot undo.";

    public UndoCommand() {}


    @Override
    public CommandResult execute() {
        assert model != null; 
        try {
            model.undoTaskboss();
            return new CommandResult(MESSAGE_SUCCESS);	
        } catch (EmptyStackException ese) {
            return new CommandResult(MESSAGE_WITHOUT_PREVIOUS_OPERATION);
        }
    }
}

@@ -133,18 +133,17 @@
 er.%0A */%0A
- 
 %0A
+
 public c
@@ -177,18 +177,17 @@
 mmand %7B%0A
-%09
 %0A
+
     publ
@@ -232,21 +232,17 @@
 %22undo%22;%0A
-    
 %0A
+
     publ
@@ -392,21 +392,17 @@
 D_WORD;%0A
-    
 %0A
+
     publ
@@ -492,13 +492,9 @@
 !%22;%0A
-    
 %0A
+
     
@@ -684,17 +684,16 @@
 != null;
- 
 %0A       
@@ -733,16 +733,16 @@
 boss();%0A
+
         
@@ -787,17 +787,16 @@
 UCCESS);
-%09
 %0A       

Fix trailing white space