summaryrefslogtreecommitdiff
path: root/examples/python_scripting.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-05-07 21:01:56 -0600
committerkotfu <kotfu@kotfu.net>2018-05-07 21:01:56 -0600
commitf5f0c90aa44ec658b33da422c4f0dc1cea2e6b98 (patch)
treed9971edb68c475428d306ecb276e58dc15fca5d2 /examples/python_scripting.py
parentd6d92949784b223ad03f70999bc55518c92d9fc9 (diff)
downloadcmd2-git-f5f0c90aa44ec658b33da422c4f0dc1cea2e6b98.tar.gz
Make alias checking and command parsing use the same regex
Provide a new is_valid_command() method on StatementParser to determine whether a string of characters could be a valid command. That means it can’t include any redirection, quote chars, whitespace, or terminator characters. This method is used when someone tries to create an alias, to ensure when we try and parse the alias that it will actually parse. This nicely encapsulates and standardizes all the logic for parsing and expansion into the StatementParser class. Also fix a bug in the regex to match valid command names, and add a bunch of new unit tests to ensure the bug stays fixed.
Diffstat (limited to 'examples/python_scripting.py')
0 files changed, 0 insertions, 0 deletions