forked from nus-cs2103-AY2324S2/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved welcome and goodbye message definitions into the Earl class instead. Add HelpHandler A help command is invoked when the user types "help", or an invalid input, enumerating the list of available commands.
- Loading branch information
Showing
8 changed files
with
65 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package earl.logic; | ||
|
||
import earl.util.TaskList; | ||
import earl.util.Ui; | ||
|
||
/** | ||
* Class responsible for displaying list of available commands. | ||
*/ | ||
public class HelpHandler extends Handler { | ||
|
||
public HelpHandler(String args) { | ||
super(args); | ||
} | ||
|
||
@Override | ||
public void handle(TaskList tasks, Ui ui) { | ||
if (!args.isEmpty()) { | ||
ui.buildResponse("Input defies parsing: " + args); | ||
} | ||
ui.buildResponse("Pray, issue a command forthwith."); | ||
ui.buildResponse("The sanctioned commands unfold:"); | ||
for (HandlerType type : HandlerType.values()) { | ||
ui.buildResponse("-" + type.name().toLowerCase()); | ||
} | ||
ui.completeResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters