Skip to content

Commit

Permalink
Merge pull request #330 from tayruxin/master
Browse files Browse the repository at this point in the history
Edit Delete planned enhancement
  • Loading branch information
tayruxin authored Nov 14, 2023
2 parents bebf8b4 + e7cee0d commit 9dcacdf
Showing 1 changed file with 4 additions and 3 deletions.
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.
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

0 comments on commit 9dcacdf

Please sign in to comment.