Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Improvements for message.command #292
Conversation
Enables easier and standard parsing, for quote wrapped args, etc. Filters.command now has a posix argument, and the separator argument was removed. shlex.split() works similar to having before separator=None.
- Removed "posix" parameter because we only want posix=True and the filter becomes simpler.
- Figured out how to deal with single backslashes ("\") errors.
- Refactor the whole filter: use better names for identifiers.
- Rename parameter "prefix" to "prefixes".
|
As we discussed in the group, I've updated the filter. We still have the issue about unmatched quotes, though. |
- Use regex for case sensitivity - Less indentation - Ensure that the command returned is the correct case - Ensure that if the command has more text, it is split by whitespace
- Remove negative lookahead to fix "\"" reporting commas - Escape cmd when interpolating the pattern - Remove the escape character from the arguments - Return True when a valid command is found, return False at the end


Enables easier and standard parsing, for quote wrapped args, etc.
Filters.command now has a posix argument, and the separator argument was
removed. shlex.split() works similar to having before separator=None.