diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 0a9aa57592f..c924ac18c8a 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -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`
- ![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`
+ ![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` diff --git a/docs/images/findPeterJohnResult.png b/docs/images/findPeterJohnResult.png new file mode 100644 index 00000000000..044c3ecf1e6 Binary files /dev/null and b/docs/images/findPeterJohnResult.png differ