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

Edit Delete planned enhancement #330

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1009,14 +1009,15 @@ Currently, the user can only delete one company at once. However, there will be

**Proposed Enhancement**

Enable the user to input multiple indices when attempting to delete entries. Users can separate each index with a comma.
The `DeleteCommandParser` will then split the string by commas and remove the companies corresponding to the specified indices. There will also be checks to see if the user keyed in the same index more than once. If the same index is keyed in more than once, the parser will accept the input but treat it as if the user only keyed in that same index once.
Enable the user to input multiple indices when attempting to delete entries. Users can separate each index with a comma. If the user wishes to delete a range of indices, they can use a dash, to indicate the range. The format to delete a range of companies is `INDEX_START - INDEX_END`.
The `DeleteCommandParser` will split the string by commas and remove the companies corresponding to the specified indices. There will also be checks to see if the user keyed in the same index more than once. If the same index is keyed in more than once, the parser will accept the input but treat it as if the user only keyed in that same index once.
GlendaChong marked this conversation as resolved.
Show resolved Hide resolved
If the user keys in a range of indices, the parser will check if `INDEX_START` is smaller than `INDEX_END`. If `INDEX_START` is larger than `INDEX_END`, an error message will be displayed to the user. Besides, if `INDEX_END` is larger than the size of the list of companies, an error message will also be displayed to the user. `INDEX_START` and `INDEX_END` must be positive integers less than or equal to the maximum integer.

**Examples**

- `delete 1, 2`: deletes companies at index 1 and 2.
- `delete 1`: deletes company at index 1.
- `delete 4, 3, 7, 2`: deletes companies at index 4, 3, 7, 2.
- `delete 4 - 7`: deletes companies at index 4, 5, 6, 7.

<div style="page-break-after: always;"></div>

Expand Down
Loading