diff options
author | kotfu <kotfu@kotfu.net> | 2018-05-26 14:01:07 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-05-26 14:01:07 -0600 |
commit | bc91e16bbd08197beea1c9a115ccc5f921cfb3d6 (patch) | |
tree | fa8d1ec277fc04a6dfc5b1cd4412d691f2c06a69 /docs | |
parent | cad21a60fa92ebe4a7c177142d273f9f7497967b (diff) | |
download | cmd2-git-bc91e16bbd08197beea1c9a115ccc5f921cfb3d6.tar.gz |
Allow registration of multiple postparsing hooks
Diffstat (limited to 'docs')
-rw-r--r-- | docs/hooks.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/hooks.rst b/docs/hooks.rst index c28f9b8f..1402fee5 100644 --- a/docs/hooks.rst +++ b/docs/hooks.rst @@ -59,3 +59,22 @@ the various hook methods, presented in chronological order starting with the one .. automethod:: cmd2.cmd2.Cmd.postcmd .. automethod:: cmd2.cmd2.Cmd.postparsing_postcmd + +Registering hooks +----------------- + +As an alternative to overriding one of the hook methods, you can register any number of functions +to be called when the hook is processed. These registered functions are called before any overridden +method. + +This method of registering and calling multiple hooks allows plugins to tap into the hook mechanism +without interfering with each other or with your code. + +register_preloop_hook +register_postloop_hook + +register_preparsing_hook +register_postparsing_hook +register_precmd_hook +register_postcmd_hook +register_cmdcompleted_hook |