-
Notifications
You must be signed in to change notification settings - Fork 5
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
Able to delete in group for delete feature #103
Conversation
delete command had no functionality to delete via a group. Added this functionality so that it is easier to delete large groups of contacts at once if required.
Modify delete command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. The stuff mentioned are things that can be improved on but it does not require immediate attention.
@@ -21,29 +25,69 @@ public class DeleteCommand extends Command { | |||
public static final String MESSAGE_USAGE = COMMAND_WORD | |||
+ ": Deletes the person identified by the NusId used in the displayed person list.\n" | |||
+ "Parameters: NusId (8 digits long, starting with an 'E'). \n" | |||
+ "Example: " + COMMAND_WORD + " E0123456"; | |||
+ "Example: " + COMMAND_WORD + " id/E0123456\n\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is intentional but there are a double \n here
@@ -51,7 +51,7 @@ public void parseCommand_clear() throws Exception { | |||
public void parseCommand_delete() throws Exception { | |||
NusId testNusId = new NusId("E1234567"); | |||
DeleteCommand command = (DeleteCommand) parser.parseCommand( | |||
DeleteCommand.COMMAND_WORD + " " + testNusId); | |||
DeleteCommand.COMMAND_WORD + " id/" + testNusId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use the ParserUtil prefix instead of adding it ourselves
Closes #51 |
if (arePrefixesPresent(argMultimap, PREFIX_NUSID) | ||
&& !arePrefixesPresent(argMultimap, PREFIX_GROUP) | ||
&& !arePrefixesPresent(argMultimap, PREFIX_TAG)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we really need to create a common method in ParserUtils that accepts an array of args
No description provided.