summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcatherine devlin <catherine.devlin@gmail.com>2010-09-21 15:25:56 -0400
committercatherine devlin <catherine.devlin@gmail.com>2010-09-21 15:25:56 -0400
commit7b1f5fbab4d5411cde4531d279c738a484e282e8 (patch)
tree7ef9dfb11e5ac3b9e1d62e5771d5e22efcd6a4fb
parentb4027111f5327d8f8d4d2071aff0e28afc286c48 (diff)
downloadcmd2-hg-7b1f5fbab4d5411cde4531d279c738a484e282e8.tar.gz
added postparse
-rwxr-xr-xcmd2.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index 6cfc9e5..5e8209c 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -702,7 +702,9 @@ class Cmd(cmd.Cmd):
def preparse(self, raw, **kwargs):
return raw
-
+ def postparse(self, parseResult):
+ return parseResult
+
def parsed(self, raw, **kwargs):
if isinstance(raw, ParsedString):
p = raw
@@ -718,6 +720,7 @@ class Cmd(cmd.Cmd):
result = self.parser.parseString(s)
result['raw'] = raw
result['command'] = result.multilineCommand or result.command
+ result = self.postparse(result)
p = ParsedString(result.args)
p.parsed = result
p.parser = self.parsed