Skip to content

Commit 33049bf

Browse files
committed
Add cross-references and links
1 parent 5c52420 commit 33049bf

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

docs/examples/alternate_event_loops.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,27 @@ the main loop for the program by using code like the following::
4646

4747
app.postloop()
4848

49-
The **runcmds_plus_hooks()** method is a convenience method to run multiple
50-
commands via **onecmd_plus_hooks()**.
49+
The :meth:`~cmd2.Cmd.runcmds_plus_hooks()` method runs multiple commands via
50+
:meth:`~cmd2.Cmd.onecmd_plus_hooks`.
5151

52-
The **onecmd_plus_hooks()** method will do the following to execute a single
53-
``cmd2`` command in a normal fashion:
52+
The :meth:`~cmd2.Cmd.onecmd_plus_hooks()` method will do the following to
53+
execute a single command in a normal fashion:
5454

55-
#. Parse user input into `Statement` object
56-
#. Call methods registered with `register_postparsing_hook()`
55+
#. Parse user input into a :class:`~cmd2.Statement` object
56+
#. Call methods registered with :meth:`~cmd2.Cmd.register_postparsing_hook()`
5757
#. Redirect output, if user asked for it and it's allowed
5858
#. Start timer
59-
#. Call methods registered with `register_precmd_hook()`
60-
#. Call `precmd()` - for backwards compatibility with ``cmd.Cmd``
61-
#. Add statement to history
59+
#. Call methods registered with :meth:`~cmd2.Cmd.register_precmd_hook`
60+
#. Call :meth:`~cmd2.Cmd.precmd` - for backwards compatibility with ``cmd.Cmd``
61+
#. Add statement to :ref:`features/history:History`
6262
#. Call `do_command` method
63-
#. Call methods registered with `register_postcmd_hook()`
64-
#. Call `postcmd(stop, statement)` - for backwards compatibility with
63+
#. Call methods registered with :meth:`~cmd2.Cmd.register_postcmd_hook()`
64+
#. Call :meth:`~cmd2.Cmd.postcmd` - for backwards compatibility with
6565
``cmd.Cmd``
6666
#. Stop timer and display the elapsed time
6767
#. Stop redirecting output if it was redirected
68-
#. Call methods registered with `register_cmdfinalization_hook()`
68+
#. Call methods registered with
69+
:meth:`~cmd2.Cmd.register_cmdfinalization_hook()`
6970

7071
Running in this fashion enables the ability to integrate with an external event
7172
loop. However, how to integrate with any specific event loop is beyond the
@@ -75,8 +76,3 @@ with several disadvantages, including:
7576
* Requires the developer to write more code
7677
* Does not support transcript testing
7778
* Does not allow commands at invocation via command-line arguments
78-
79-
Here is a little more info on ``runcmds_plus_hooks``:
80-
81-
.. automethod:: cmd2.Cmd.runcmds_plus_hooks
82-
:noindex:

0 commit comments

Comments
 (0)