package seedu.tasklist.logic.commands;

/**
 * Shows all tasks that fulfill the category keyword.
 * Keyword matching is case insensitive.
 */
public class ShowCommand extends Command {

    public static final String COMMAND_WORD = "show";

    public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows all tasks under the requested category. "
            + "The specified keywords (case-insensitive) are shown as a list with index numbers.\n"
            + "Parameters: KEYWORD (all, incomplete, complete, p/[PRIORITY]\n"
            + "Example: " + COMMAND_WORD + " all";

    public static final String MESSAGE_SHOW_FAILURE = "Invalid category. Available categories: all, incomplete, complete, p/[PRIORITY]";
    public static final String MESSAGE_SUCCESS = "Shown requested tasks.";
    private final String keyword;
    
    public ShowCommand(String keyword) {
        this.keyword = keyword;
    }

    @Override
    public CommandResult execute() {
    	switch (keyword) {
    	
        case "all":
    	    model.updateFilteredListToShowAll(); break;
    	    
        case "incomplete":
            model.updateFilteredListToShowIncomplete(); break;
    		
        case "complete":
            model.updateFilteredListToShowComplete(); break;
    		
        case "p/high": case "p/med": case "p/low":
            model.updateFilteredListToShowPriority(keyword); break;
    	
        default:
            return new CommandResult(String.format(MESSAGE_SHOW_FAILURE));
    	}
        return new CommandResult(String.format(getMessageForTaskListShownSummary(model.getFilteredTaskList().size())));
    }
}
@@ -33,16 +33,91 @@
 mands;%0A%0A
+import java.util.Date;%0A%0Aimport seedu.tasklist.logic.parser.TimePreparser;%0A%0A
 /**%0A * S
@@ -1044,16 +1044,57 @@
     
-%09switch 
+    String requestedTime = TimePreparser.preparse
 (key
@@ -1102,36 +1102,52 @@
 ord)
- %7B
+;
 %0A    
-%09%0A
     
+%0A
     
-case 
+%09if (keyword.equals(
 %22all%22
-:
+)) %7B
 %0A   
@@ -1192,39 +1192,40 @@
 l();
- break;%0A    %09    %0A        case 
+%0A    %09%7D else if (keyword.equals(
 %22inc
@@ -1224,33 +1224,36 @@
 als(%22incomplete%22
-:
+)) %7B
 %0A            mod
@@ -1296,36 +1296,40 @@
 e();
- break;%0A    %09%09%0A        case 
+%0A    %09%7D else if (keyword.equals(
 %22com
@@ -1334,17 +1334,20 @@
 omplete%22
-:
+)) %7B
 %0A       
@@ -1396,73 +1396,106 @@
 e();
- break;%0A    %09%09%0A        case %22p/high%22: case %22p/med%22: case 
+%0A    %09%7D else if (keyword.equals(%22p/high%22) %7C%7C keyword.equals(%22p/med%22) %7C%7C keyword.equals(
 %22p/low%22
-:
+)) %7B
 %0A   
@@ -1555,38 +1555,162 @@
 rd);
- break;%0A    %09
+%0A    %09%7D else if (!requestedTime.isEmpty() && !requestedTime.equals(new Date(0).toString())) %7B
 %0A    
+%09
     
-default:
+model.updateFilteredListToShowDate();%0A    %09%7D else %7B
 %0A   

Update showcommand to show with requested date