Skip to content

Commit

Permalink
Merge pull request #143 from yuheem/140-add-help
Browse files Browse the repository at this point in the history
Add help command
  • Loading branch information
yuheem authored Apr 1, 2021
2 parents 4d07889 + 30c6eab commit 864b7d9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/main/java/seedu/budgetbaby/logic/commands/HelpCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package seedu.budgetbaby.logic.commands;

import seedu.budgetbaby.model.BudgetBabyModel;

/**
* Format help instructions for every command for display.
*/
public class HelpCommand extends BudgetBabyCommand {
public static final String COMMAND_WORD = "help";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows program usage instructions.\n"
+ "Example: " + COMMAND_WORD;

public static final String SHOWING_HELP_MESSAGE = "Opened help window.";

@Override
public CommandResult execute(BudgetBabyModel model) {
return new CommandResult(SHOWING_HELP_MESSAGE, true, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import seedu.budgetbaby.ablogic.commands.HelpCommand;
import seedu.budgetbaby.logic.commands.AddFrCommand;
import seedu.budgetbaby.logic.commands.BudgetBabyCommand;
import seedu.budgetbaby.logic.commands.DeleteFrCommand;
import seedu.budgetbaby.logic.commands.EditFrCommand;
import seedu.budgetbaby.logic.commands.ExitCommand;
import seedu.budgetbaby.logic.commands.FindFrCommand;
import seedu.budgetbaby.logic.commands.HelpCommand;
import seedu.budgetbaby.logic.commands.RedoCommand;
import seedu.budgetbaby.logic.commands.ResetFilterCommand;
import seedu.budgetbaby.logic.commands.SetBudgetCommand;
Expand Down Expand Up @@ -78,6 +78,9 @@ public BudgetBabyCommand parseCommand(String userInput) throws ParseException {
case ExitCommand.COMMAND_WORD:
return new ExitCommand();

case HelpCommand.COMMAND_WORD:
return new HelpCommand();

default:
throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
}
Expand Down

0 comments on commit 864b7d9

Please sign in to comment.