Skip to content

Commit ec404a6

Browse files
committed
Minor doc updates that fix a few typos and inaccuracies
1 parent 911d965 commit ec404a6

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

docs/argument_processing.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ Help Messages
9393

9494
By default, cmd2 uses the docstring of the command method when a user asks
9595
for help on the command. When you use the ``@with_argparser``
96-
decorator, the docstring for the ``do_*`` method is used to set the description for the ``argparse.ArgumentParser`` is
96+
decorator, the docstring for the ``do_*`` method is used to set the description for the ``argparse.ArgumentParser``.
97+
9798
With this code::
9899

99100
import argparse
@@ -108,7 +109,7 @@ With this code::
108109
self.stdout.write('<{0}>{1}</{0}>'.format(args.tag, ' '.join(args.content)))
109110
self.stdout.write('\n')
110111

111-
The ``help tag`` command displays:
112+
the ``help tag`` command displays:
112113

113114
.. code-block:: none
114115

docs/freefeatures.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ You may optionally enable full access to to your application by setting
135135
session, which is a reference to your Cmd2 application. This can be useful for
136136
debugging your application. To prevent users from enabling this ability
137137
manually you'll need to remove ``locals_in_py`` from the ``settable`` dictionary.
138-
That session can call
139138

140139
The ``app`` object (or your custom name) provides access to application commands
141140
through either raw commands or through a python API wrapper. For example, any

docs/hooks.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Here's how to define and register a postcommand hook::
239239
self.register_postcmd_hook(self.myhookmethod)
240240

241241
def myhookmethod(self, data: cmd2.plugin.PostcommandData) -> cmd2.plugin.PostcommandData:
242-
return stop
242+
return data
243243

244244
Your hook will be passed a ``PostcommandData`` object, which has a ``statement``
245245
attribute that describes the command which was executed. If your postcommand
@@ -254,10 +254,11 @@ After all registered postcommand hooks have been called,
254254
``self.postcmd(statement)`` will be called to retain full backward compatibility
255255
with ``cmd.Cmd``.
256256

257-
If any postcommand hook (registered or ``self.postcmd()``) returns ``True``,
258-
subsequent postcommand hooks will still be called, as will the command
259-
finalization hooks, but once those hooks have all been called, the application
260-
will terminate.
257+
If any postcommand hook (registered or ``self.postcmd()``) returns a ``PostcommandData`` object
258+
with the stop attribute set to ``True``, subsequent postcommand hooks will still be called, as
259+
will the command finalization hooks, but once those hooks have all been called, the application
260+
will terminate. Likewise, if ``self.postcmd()`` returns ``True``, the command finalization hooks
261+
will be called before the application terminates.
261262

262263
Any postcommand hook can change the value of the ``stop`` parameter before
263264
returning it, and the modified value will be passed to the next postcommand

0 commit comments

Comments
 (0)