summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/hooks.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/hooks.rst b/docs/hooks.rst
index 7141c729..b07f1e94 100644
--- a/docs/hooks.rst
+++ b/docs/hooks.rst
@@ -163,6 +163,10 @@ If a postparsing hook returns ``True`` as the first value in the tuple:
Precommand Hooks
^^^^^^^^^^^^^^^^^
+A precommand hook is defined in ``cmd.Cmd``. It is not able to request that the
+app terminate, but it is passed the user input and allowed to make changes. If
+your hook needs to be able to exit the application, you should implement it as a postparsing hook.
+
Once output is redirected and the timer started, all the hooks registered with
``register_precmd_hook()`` are called. Here's how you do it::