Skip to content

Fix bug with unrecognised commands #101

Closed as not planned
Closed as not planned
@heyzec

Description

Because of the changes made to accept for multi-word commands, the parser now greedily takes in as many words as possible to treat as the command. Example to explain better:

Input: list ab
Result: Unknown command
Expected behaviour: An error to user telling that list is recognised, but the format is wrong.

One way to fix this is to refactor AddressBookParser, such that multi-word commands are sent to another secondary parser. Illustrate with examples:

Input: list ab
Sequence: AddressBookParser -> ListCommandParser -> ListCommand

Input: add student
Sequence: AddCommand -> AddStudentCommandParser -> AddStudentCommand

Input: add tutorial
Sequence: AddCommand -> AddTutorialCommandParser -> AddTutorialCommand

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions