What problem has occurred? What issues has it caused?
Shorthand reply parsing doesn't handle adding a space after a number well, like in:
sd 2 k
instead of the correct
sd 2k
On the one hand, this is a mistake according to the documentation, so we can blame the user. On the other hand:
- this is probably very easy to fix
- currently it crashes Smokey if someone types this. It doesn't consider it the same as
sd 2- k, it just provokes an uncaught IndexError.
What would you like to happen/not happen?
Let's not crash Smokey. I'd like to do that by both:
- Not processing the user's attempted commands in this case, treating this as an error instead
- Catching all parsing exceptions in
dispatch_shorthand_command, not just some of them
I'd additionally like to give a useful feedback message to the user, mentioning that they can't put a space after a number.
Alternative
Another way this could be handled would be to allow the space, treating it the same as if there were no space. That would take slightly more coding. Probably still easy. Anyone prefer that?
What problem has occurred? What issues has it caused?
Shorthand reply parsing doesn't handle adding a space after a number well, like in:
instead of the correct
On the one hand, this is a mistake according to the documentation, so we can blame the user. On the other hand:
sd 2- k, it just provokes an uncaughtIndexError.What would you like to happen/not happen?
Let's not crash Smokey. I'd like to do that by both:
dispatch_shorthand_command, not just some of themI'd additionally like to give a useful feedback message to the user, mentioning that they can't put a space after a number.
Alternative
Another way this could be handled would be to allow the space, treating it the same as if there were no space. That would take slightly more coding. Probably still easy. Anyone prefer that?