diff options
author | kotfu <kotfu@kotfu.net> | 2020-02-24 22:41:33 -0700 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2020-02-24 22:41:33 -0700 |
commit | 33049bf86f031dd48f052848701f4efc8634b34d (patch) | |
tree | e659320e365537a6fed5de5cb47e056ef39e3bf0 /docs | |
parent | 5c52420b2ba081965a670cef0d5889eb19237420 (diff) | |
download | cmd2-git-33049bf86f031dd48f052848701f4efc8634b34d.tar.gz |
Add cross-references and links
Diffstat (limited to 'docs')
-rw-r--r-- | docs/examples/alternate_event_loops.rst | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/docs/examples/alternate_event_loops.rst b/docs/examples/alternate_event_loops.rst index 41e27369..b0ee7f8e 100644 --- a/docs/examples/alternate_event_loops.rst +++ b/docs/examples/alternate_event_loops.rst @@ -46,26 +46,27 @@ the main loop for the program by using code like the following:: app.postloop() -The **runcmds_plus_hooks()** method is a convenience method to run multiple -commands via **onecmd_plus_hooks()**. +The :meth:`~cmd2.Cmd.runcmds_plus_hooks()` method runs multiple commands via +:meth:`~cmd2.Cmd.onecmd_plus_hooks`. -The **onecmd_plus_hooks()** method will do the following to execute a single -``cmd2`` command in a normal fashion: +The :meth:`~cmd2.Cmd.onecmd_plus_hooks()` method will do the following to +execute a single command in a normal fashion: -#. Parse user input into `Statement` object -#. Call methods registered with `register_postparsing_hook()` +#. Parse user input into a :class:`~cmd2.Statement` object +#. Call methods registered with :meth:`~cmd2.Cmd.register_postparsing_hook()` #. Redirect output, if user asked for it and it's allowed #. Start timer -#. Call methods registered with `register_precmd_hook()` -#. Call `precmd()` - for backwards compatibility with ``cmd.Cmd`` -#. Add statement to history +#. Call methods registered with :meth:`~cmd2.Cmd.register_precmd_hook` +#. Call :meth:`~cmd2.Cmd.precmd` - for backwards compatibility with ``cmd.Cmd`` +#. Add statement to :ref:`features/history:History` #. Call `do_command` method -#. Call methods registered with `register_postcmd_hook()` -#. Call `postcmd(stop, statement)` - for backwards compatibility with +#. Call methods registered with :meth:`~cmd2.Cmd.register_postcmd_hook()` +#. Call :meth:`~cmd2.Cmd.postcmd` - for backwards compatibility with ``cmd.Cmd`` #. Stop timer and display the elapsed time #. Stop redirecting output if it was redirected -#. Call methods registered with `register_cmdfinalization_hook()` +#. Call methods registered with + :meth:`~cmd2.Cmd.register_cmdfinalization_hook()` Running in this fashion enables the ability to integrate with an external event loop. However, how to integrate with any specific event loop is beyond the @@ -75,8 +76,3 @@ with several disadvantages, including: * Requires the developer to write more code * Does not support transcript testing * Does not allow commands at invocation via command-line arguments - -Here is a little more info on ``runcmds_plus_hooks``: - -.. automethod:: cmd2.Cmd.runcmds_plus_hooks - :noindex: |