CortexPE / Commando

A Command Framework virion for PocketMine-MP
GNU Lesser General Public License v3.0
70 stars 53 forks source link

i dont like the way you parse arguments #6

Closed lukeeey closed 5 years ago

lukeeey commented 5 years ago

With the current PMMP system, if you have a command such as /setrank <player> <rankName>, if you specify an incorrect player and an incorrect rank, the only error you will get is Player not found, as you obviously check that argument first. With this library, it complains about the invalid rank name (its an enum with specific values) and it wont complain about the player not being found until i give a valid rank name.

i dont like this. pls fix

CortexPE commented 5 years ago

It wouldn't complain about the player if you didn't check if the player is online or not in BaseSubCommand::canParse()

On Mon, Jun 3, 2019, 12:00 AM Luke notifications@github.com wrote:

With the current PMMP system, if you have a command such as /setrank

, if you specify an incorrect player and an incorrect rank, the only error you will get is Player not found, as you obviously check that argument first. With this library, it complains about the invalid rank name (its an enum with specific values) and it wont complain about the player not being found until i give a valid rank name. i dont like this. pls fix — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
CortexPE commented 5 years ago

And as mentioned on the other issue, you'll need to check the returned parsed arguments on $args yourself... If it's null or not set

On Mon, Jun 3, 2019, 10:23 AM CortexPE mcpe4life62@gmail.com wrote:

It wouldn't complain about the player if you didn't check if the player is online or not in BaseSubCommand::canParse()

On Mon, Jun 3, 2019, 12:00 AM Luke notifications@github.com wrote:

With the current PMMP system, if you have a command such as /setrank

, if you specify an incorrect player and an incorrect rank, the only error you will get is Player not found, as you obviously check that argument first. With this library, it complains about the invalid rank name (its an enum with specific values) and it wont complain about the player not being found until i give a valid rank name. i dont like this. pls fix — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .