Skip to content

Commit 1079ebc

Browse files
committed
use .. program:: directive for documenting pdb CLI
1 parent 72e5b25 commit 1079ebc

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

Doc/library/pdb.rst

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,36 @@ The debugger's prompt is ``(Pdb)``, which is the indicator that you are in debug
7575
arguments of the ``p`` command.
7676

7777

78+
.. program:: pdb
79+
7880
You can also invoke :mod:`pdb` from the command line to debug other scripts. For
79-
example::
81+
example:
82+
83+
.. code-block:: bash
8084
81-
python -m pdb myscript.py
85+
python -m pdb [-h] [-c command] (-m module | pyfile) [args ...]
8286
8387
When invoked as a module, pdb will automatically enter post-mortem debugging if
8488
the program being debugged exits abnormally. After post-mortem debugging (or
8589
after normal exit of the program), pdb will restart the program. Automatic
8690
restarting preserves pdb's state (such as breakpoints) and in most cases is more
8791
useful than quitting the debugger upon program's exit.
8892

89-
.. versionchanged:: 3.2
90-
Added the ``-c`` option to execute commands as if given
91-
in a :file:`.pdbrc` file; see :ref:`debugger-commands`.
93+
.. option:: -c, --command <command>
9294

93-
.. versionchanged:: 3.7
94-
Added the ``-m`` option to execute modules similar to the way
95-
``python -m`` does. As with a script, the debugger will pause execution just
96-
before the first line of the module.
95+
To execute commands as if given in a :file:`.pdbrc` file; see
96+
:ref:`debugger-commands`.
97+
98+
.. versionchanged:: 3.2
99+
Added the ``-c`` option.
100+
101+
.. option:: -m <module>
102+
103+
To execute modules similar to the way ``python -m`` does. As with a script,
104+
the debugger will pause execution just before the first line of the module.
105+
106+
.. versionchanged:: 3.7
107+
Added the ``-m`` option.
97108

98109
Typical usage to execute a statement under control of the debugger is::
99110

0 commit comments

Comments
 (0)