More documentation can be found in the UG and DG respectively.
Format: deletebyname NAME
Deletes the person with the specified NAME.
The name refers to the exact name of the person in the address book.
The name is case insensitive.
Examples:
deletebyname John Doe
Deletes John Doe in the address book, if the person exists.
If there is no person with a matching name can be found, it will update the displayed person list to provide suggestions on possible persons to delete.
If there is more than 1 person with the exact same name, it will update the displayed person list to show all the persons with the same name. You will then be prompted to use the delete command.
Advantage(s) versus DeleteCommand:
Allows users to carry out delete operations regardless of the last shown list.
Disadvantage(s) versus DeleteCommand:
Requires the exact name of the person to be deleted in order to perform a successful deletion.
Inability to delete a person if there is another person with the exact name present in the Address Book.
In order to mitigate the disadvantages when compared to DeleteCommand, DeleteByNameCommand also suggests possible persons for deletion with similar names when no matching name is found in the Address Book. The Model is also updated to display the list of suggested persons, similar to FindCommand.
DeleteByNameCommand also updates the Model to list all persons with matching names if there is more than 1 person with the exact same name as the person to be deleted. This is an enhancement over the traditional FindCommand as it will not list any other persons whose names match part of the query. It will then prompt users to utilise the DeleteCommand.
v1.1.5 does not have exception handling of multiple persons with the same name (it will just delete the first person who matches that criteria, very bad implementation), neither will it suggest persons to delete.
As the name suggests, this command allows users to delete with the person's name. The description shown below is for implementation v1.2. It can be found from this branch: https://github.com/AceCentury/addressbook-level4/tree/Add_DeleteByName_Command
More documentation can be found in the UG and DG respectively.
Format: deletebyname NAME
Examples: deletebyname John Doe Deletes John Doe in the address book, if the person exists.
If there is no person with a matching name can be found, it will update the displayed person list to provide suggestions on possible persons to delete.
If there is more than 1 person with the exact same name, it will update the displayed person list to show all the persons with the same name. You will then be prompted to use the delete command.
Advantage(s) versus DeleteCommand:
Disadvantage(s) versus DeleteCommand:
Requires the exact name of the person to be deleted in order to perform a successful deletion.
Inability to delete a person if there is another person with the exact name present in the Address Book.
In order to mitigate the disadvantages when compared to
DeleteCommand
,DeleteByNameCommand
also suggests possible persons for deletion with similar names when no matching name is found in the Address Book. The Model is also updated to display the list of suggested persons, similar toFindCommand
.DeleteByNameCommand
also updates the Model to list all persons with matching names if there is more than 1 person with the exact same name as the person to be deleted. This is an enhancement over the traditionalFindCommand
as it will not list any other persons whose names match part of the query. It will then prompt users to utilise theDeleteCommand
.For those interested in v1.1.5, you may refer to this commit: https://github.com/AceCentury/addressbook-level4/commit/836e702e5ada5ab494f80eeef6cae0e8c9793d90
v1.1.5 does not have exception handling of multiple persons with the same name (it will just delete the first person who matches that criteria, very bad implementation), neither will it suggest persons to delete.