AY2425S1-CS2103T-T15-1 / tp

Other
0 stars 5 forks source link

Modify `find` Command to Accept Prefixes #175

Open RobotWizzard opened 1 week ago

RobotWizzard commented 1 week ago

Modify the find command to accept prefixes n/, p, e/, t/, just like the cadd command. The find command finds clients whose details match one or more of the prefixes. Found clients are displayed based on the number of prefixes matched.

The k/ prefix matches in all fields, and can accept duplicates. Duplicate k/ arguments match separately (i.e. k/bernice k/yu will match "bernice" and "yu", whereas k/bernice yu will match "bernice yu").


For example, if the app currently stores clients

  1. John Doe; Phone: 98765432; Email: johnd@example.com; Tags: [owesMoney][friends]
  2. John Tan; Phone: 00800912; Email: johnt@example.com; Tags: [colleagues][friends]
  3. Bernice Yu; Phone: 12345789; Email: berniceyu@example.com; Tags: [colleagues][friends]


the command find n/John p/00800912 will result in:

  1. John Doe; Phone: 98765432; Email: johnd@example.com; Tags: [owesMoney][friends]
  2. John Tan; Phone: 00800912; Email: johnt@example.com; Tags: [colleagues][friends]

winstonlimjy commented 1 week ago

Perhaps could modify "find" command, if it is to filter the list by tags