Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change prioritize command syntax #167

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public AddCommand parse(String args) throws ParseException {

boolean isRemindPresent = args.matches(".*\\bremind\\b$");
boolean isRemindTypo = false;
boolean isPriorityPresent = args.matches(".*\\bpriority/\\b.*");
boolean isPriorityPresent = args.matches(".*\\bp/\\b.*");

if (!isRemindPresent) {
isRemindTypo = args.matches(".*rem[a-z]*$");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public class CliSyntax {
public static final Prefix PREFIX_TIMETABLE_URL = new Prefix("url/");
public static final Prefix PREFIX_EXPECTED_HOURS = new Prefix("expected/");
public static final Prefix PREFIX_DO_BEFORE = new Prefix("before/");
public static final Prefix PREFIX_PRIORITY = new Prefix("priority/");
public static final Prefix PREFIX_PRIORITY = new Prefix("p/");
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void parse_invalidArgs_throwsParseException() {
//invalid module code
assertParseFailure(parser, " mod/CS386", ModuleCode.MESSAGE_CONSTRAINTS);
//invalid priority
assertParseFailure(parser, " priority/NO", Priority.MESSAGE_CONSTRAINTS);
assertParseFailure(parser, " p/NO", Priority.MESSAGE_CONSTRAINTS);
//preamble present
assertParseFailure(parser, " preamble mod/CS2100", String.format(
MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE));
Expand Down Expand Up @@ -88,6 +88,6 @@ public void parse_validArgs_returnsFindCommand() {

assertParseSuccess(parser, " d/1200 24-10-2020", expectedFindCommandByDeadline);

assertParseSuccess(parser, " priority/HIGH LOW", expectedFindCommandByPriority);
assertParseSuccess(parser, " p/HIGH LOW", expectedFindCommandByPriority);
}
}