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

Update find command in UG #312

Merged
merged 6 commits into from
Nov 11, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,30 @@ Examples:
* `edit 2 n/Betsy Crower c/` Edits the name of the 2nd student to be `Betsy Crower` and clears all existing courses.
* `edit 3 c/CS2103T;CS2101` Edits the courses of the 3rd student to be CS2103T & CS2101.

### Locating students by name: `find`
### Locating students by name and/or course: `find`

Finds students whose names contain any of the given keywords.

Format: `find KEYWORD [MORE_KEYWORDS]`

* The search is case-insensitive. e.g `hans` will match `Hans`
* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans`
* Only the name is searched.
* Only full words will be matched e.g. `Han` will not match `Hans`
* Students matching at least one keyword will be returned (i.e. `OR` search).
e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang`
* The search is case-insensitive. e.g `hans` will match `Hans`, `cs2103t` will match `CS2103T`
* Can search for names and courses. Use the `n/` prefix to search for names and the `c/` prefix to search for courses.
* Partial searches will be matched e.g. `Jam` will match `James` and `James Ho`
* Each sequence of words not separated by `;` or a prefix will be used as a search. This means that `jam ho` will not match `James Ho`
* If a semicolon was used to separate searches, students matching at least one keyword will be returned (i.e. `OR` search).
* If a prefix was used to separate searches, students matching all keywords will be returned (i.e. `AND` search).
* If no names are provided to the find command (i.e. `find n/`), all students will be listed.
* **Warning**: `find c/` will not be treated as an error and will return 0 students. Refer to the [Proposed Features](#proposed features) below for details of the proposed changes to this command.

Examples:
* `find John` returns `john` and `John Doe`
* `find alex david` returns `Alex Yeoh`, `David Li`<br>
![result for 'find alex david'](images/findAlexDavidResult.png)
* `find n/John` returns `john` and `John Doe`
* `find n/alex;david` returns `Alex Yeoh`, `David Li`<br>
![result for 'find n/peter;john'](images/findPeterJohnResult.png)
* `find n/alex n/david` returns `Alex David`, if a student with that name exists
* `find c/CS2103T c/CS2100` will return students who are taking both `CS2103T` and `CS2100`
* `find n/alex c/cs2103t;cs2100` will return all students whose names contain `alex` and are taking at least one of `CS2103T` or `CS2101`.
* `find n/` will return all students.
* `find c/` will return no students.

### Deleting a student : `delete`

Expand Down
Binary file added docs/images/findPeterJohnResult.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.