Skip to content

Commit c240c2d

Browse files
authored
gh-130160: use .. program:: directive for documenting pdb CLI (#130996)
1 parent 92e5f82 commit c240c2d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

Doc/library/pdb.rst

+17-8
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,34 @@ 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
7981
example::
8082

81-
python -m pdb myscript.py
83+
python -m pdb [-c command] (-m module | pyfile) [args ...]
8284

8385
When invoked as a module, pdb will automatically enter post-mortem debugging if
8486
the program being debugged exits abnormally. After post-mortem debugging (or
8587
after normal exit of the program), pdb will restart the program. Automatic
8688
restarting preserves pdb's state (such as breakpoints) and in most cases is more
8789
useful than quitting the debugger upon program's exit.
8890

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`.
91+
.. option:: -c, --command <command>
9292

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

98107
Typical usage to execute a statement under control of the debugger is::
99108

0 commit comments

Comments
 (0)