summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-05-27 17:55:37 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-05-27 17:55:37 -0400
commit2fb807845249d68d55fc7cf1bcbff46511c7851e (patch)
tree5c8544047e7474ac0b35e9da6ada69c392993b59 /cmd2/cmd2.py
parent8f88f819fae7508066a81a8d961a7115f2ec4bed (diff)
downloadcmd2-git-2fb807845249d68d55fc7cf1bcbff46511c7851e.tar.gz
Fixed bug where preparse() wasn't called before parsing
Also: - Deleted postparse() since it was redundant with postparsing_precmd()
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 04758ed7..05902a3c 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1620,15 +1620,6 @@ class Cmd(cmd.Cmd):
return raw
# noinspection PyMethodMayBeStatic
- def postparse(self, statement: Statement) -> Statement:
- """Hook that runs immediately after parsing the user input.
-
- :param statement: Statement object populated by parsing
- :return: Statement - potentially modified Statement object
- """
- return statement
-
- # noinspection PyMethodMayBeStatic
def postparsing_precmd(self, statement: Statement) -> Tuple[bool, Statement]:
"""This runs after parsing the command-line, but before anything else; even before adding cmd to history.
@@ -1688,7 +1679,7 @@ class Cmd(cmd.Cmd):
import datetime
stop = False
try:
- statement = self._complete_statement(line)
+ statement = self._complete_statement(self.preparse(line))
(stop, statement) = self.postparsing_precmd(statement)
if stop:
return self.postparsing_postcmd(stop)