package seedu.emeraldo.logic.commands;


/**
 * Lists all tasks in Emeraldo to the user.
 */
//@@author A0139749L
public class ListCommand extends Command {

    public static final String COMMAND_WORD = "list";

    public static final String MESSAGE_LIST_ALL = "Listed all tasks";
    
    public static final String MESSAGE_USAGE = COMMAND_WORD + ": Lists all uncompleted tasks\n"
            + COMMAND_WORD + " [KEYWORD]: Lists all tasks with tags containing the specified keyword (case-sensitive)"
            + "and displays them as a list with index numbers.\n"
            + "Example: " + COMMAND_WORD + " or " + COMMAND_WORD + " homework";

    private String keyword;
    private String successMessage;
    
    public ListCommand(String keyword){
        this.keyword = keyword;
    }
    
    @Override
    public CommandResult execute() {
        if(keyword.isEmpty()){
            model.updateFilteredListToShowAll();
            this.successMessage = MESSAGE_LIST_ALL;
        }else{
            model.updateFilteredTaskList(keyword);
            this.successMessage = getMessageForTaskListShownSummary(model.getFilteredTaskList().size());
        }
        return new CommandResult(successMessage);
    }
}

@@ -277,24 +277,119 @@
 asks%22;%0A    %0A
+    public static final String MESSAGE_LIST_UNCOMPLETED = %22Listed all uncompleted tasks%22;%0A    %0A
     public s
@@ -1017,27 +1017,189 @@
 Show
-All();%0A            
+Uncompleted();%0A            this.successMessage = MESSAGE_LIST_UNCOMPLETED;%0A        %7Delse if(keyword.equalsIgnoreCase(%22all%22))%7B%0A        %09model.updateFilteredListToShowAll();%0A        %09
 this

add 'list all' command in listCommand - list all tasks change 'list' commmand to list only uncompleted tasks