Bisceto / pe

0 stars 0 forks source link

Incorrect error message for edit command #3

Open Bisceto opened 1 year ago

Bisceto commented 1 year ago

I have only tested for edit command, but it may be applicable to all commands.

I keyed in the following command in the root directory "edit CS2040 code/ CS2040SS /name DSAG"

image.png

instead of telling me that it is an invalid command, it gives me an error about the module code instead, which follows the correct format.

This can confuse the user as the wrong error message is given.

nus-pe-script commented 1 year ago

Team's Response

This is the intended behaviour and not a functionality bug. Let's break down the command to understand why:

edit CS2040 code/ CS2040SS /name DSAG

The arguments detected in the command are as follows:

  1. The unnamed argument with value "CS2040 code/ CS2040SS"

  2. The named argument "/name" with value "DSAG"

Now when the command is entered, the app attempts to parse "CS2040 code/ CS2040SS" as a module code. However, since it does not comply with the module code format, the command fails with the error message:

Module codes should begin with uppercase alphabet characters, followed by numeric characters, optionally followed by more uppercase alphabet characters

Now one might ask, shouldn't "code/" be treated as an argument and thus the value of the unnamed argument should just be "CS2040"? The reason for this is actually described in the UG. The following screenshot from the "Command Syntax" section of the UG describes the behaviour:

image.png

Since "code/" does not comply with these conditions, it is not treated as a named argument and is thus just treated as a part of the value of the unnamed argument.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: [replace this with your explanation]