diff options
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 |