diff options
author | kotfu <kotfu@kotfu.net> | 2018-06-03 12:53:05 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-06-03 12:53:05 -0600 |
commit | e5a0f306a16bb06406ba3c6f88821bfe6c8ca738 (patch) | |
tree | 86d8ecf0839491b7fa29629326886aa9fe0b366b /cmd2/cmd2.py | |
parent | eaf7415f010ab82688a0a30627a0efa2419f2837 (diff) | |
download | cmd2-git-e5a0f306a16bb06406ba3c6f88821bfe6c8ca738.tar.gz |
Begin converting precmd to passing and returning a data object
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 63ad1ea2..69d6224e 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -45,6 +45,7 @@ import pyperclip from . import constants from . import utils +from . import plugin from .parsing import StatementParser, Statement # Set up readline @@ -1704,7 +1705,10 @@ class Cmd(cmd.Cmd): # precommand hooks for func in self._precmd_hooks: - statement = func(statement) + data = plugin.PrecommandData(statement) + result = func(data) + statement = result.statement + # call precmd() for compatibility with cmd.Cmd statement = self.precmd(statement) # go run the command function |