summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-02-06 20:38:23 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-02-06 20:38:23 -0500
commitec404a6451a608ae6fcc34420b7abf8ae436d464 (patch)
treefc8ff817e8d21809a14672588fc2cf5c7cded531
parent911d9651dd5370f4432b45ba1e481309d01178d5 (diff)
downloadcmd2-git-ec404a6451a608ae6fcc34420b7abf8ae436d464.tar.gz
Minor doc updates that fix a few typos and inaccuracies
-rw-r--r--docs/argument_processing.rst5
-rw-r--r--docs/freefeatures.rst1
-rw-r--r--docs/hooks.rst11
3 files changed, 9 insertions, 8 deletions
diff --git a/docs/argument_processing.rst b/docs/argument_processing.rst
index 12fd7a60..4c77fa80 100644
--- a/docs/argument_processing.rst
+++ b/docs/argument_processing.rst
@@ -93,7 +93,8 @@ Help Messages
By default, cmd2 uses the docstring of the command method when a user asks
for help on the command. When you use the ``@with_argparser``
-decorator, the docstring for the ``do_*`` method is used to set the description for the ``argparse.ArgumentParser`` is
+decorator, the docstring for the ``do_*`` method is used to set the description for the ``argparse.ArgumentParser``.
+
With this code::
import argparse
@@ -108,7 +109,7 @@ With this code::
self.stdout.write('<{0}>{1}</{0}>'.format(args.tag, ' '.join(args.content)))
self.stdout.write('\n')
-The ``help tag`` command displays:
+the ``help tag`` command displays:
.. code-block:: none
diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst
index 7864f146..c70a2d93 100644
--- a/docs/freefeatures.rst
+++ b/docs/freefeatures.rst
@@ -135,7 +135,6 @@ You may optionally enable full access to to your application by setting
session, which is a reference to your Cmd2 application. This can be useful for
debugging your application. To prevent users from enabling this ability
manually you'll need to remove ``locals_in_py`` from the ``settable`` dictionary.
-That session can call
The ``app`` object (or your custom name) provides access to application commands
through either raw commands or through a python API wrapper. For example, any
diff --git a/docs/hooks.rst b/docs/hooks.rst
index 1696d365..35753e59 100644
--- a/docs/hooks.rst
+++ b/docs/hooks.rst
@@ -239,7 +239,7 @@ Here's how to define and register a postcommand hook::
self.register_postcmd_hook(self.myhookmethod)
def myhookmethod(self, data: cmd2.plugin.PostcommandData) -> cmd2.plugin.PostcommandData:
- return stop
+ return data
Your hook will be passed a ``PostcommandData`` object, which has a ``statement``
attribute that describes the command which was executed. If your postcommand
@@ -254,10 +254,11 @@ After all registered postcommand hooks have been called,
``self.postcmd(statement)`` will be called to retain full backward compatibility
with ``cmd.Cmd``.
-If any postcommand hook (registered or ``self.postcmd()``) returns ``True``,
-subsequent postcommand hooks will still be called, as will the command
-finalization hooks, but once those hooks have all been called, the application
-will terminate.
+If any postcommand hook (registered or ``self.postcmd()``) returns a ``PostcommandData`` object
+with the stop attribute set to ``True``, subsequent postcommand hooks will still be called, as
+will the command finalization hooks, but once those hooks have all been called, the application
+will terminate. Likewise, if ``self.postcmd()`` returns ``True``, the command finalization hooks
+will be called before the application terminates.
Any postcommand hook can change the value of the ``stop`` parameter before
returning it, and the modified value will be passed to the next postcommand