]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-103143: Polish pdb help messages and doc strings (GH-103144)
authorTian Gao <gaogaotiantian@hotmail.com>
Tue, 11 Apr 2023 22:40:30 +0000 (15:40 -0700)
committerGitHub <noreply@github.com>
Tue, 11 Apr 2023 22:40:30 +0000 (15:40 -0700)
commit2f41a009b7311a4b44bae5b3583cde3d6d10d8d1
tree3e4e9df8a4008e41e78bb9f244f65eba6d5ee298
parent96663875b2ea55c65e83551cdb741bbcdcaa7f21
gh-103143: Polish pdb help messages and doc strings  (GH-103144)

* Made all the command part of the docstring match the official documentation
* Always have a space between the command and the description in docstring
* Added a helper function to format the help message

Before:

```
(Pdb) h a
a(rgs)
        Print the argument list of the current function.
(Pdb) h commands
commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)
        ...
(Pdb) h interact
interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
```

After
```
(Pdb) h a
      Usage: a(rgs)

      Print the argument list of the current function.
(Pdb) h commands
      Usage: (Pdb) commands [bpnumber]
             (com) ...
             (com) end
             (Pdb)
             ...
(Pdb) h interact
      Usage: interact

      Start an interactive interpreter whose global namespace
      contains all the (global and local) names found in the current scope.
```

Automerge-Triggered-By: GH:brandtbucher
Doc/library/pdb.rst
Lib/pdb.py
Misc/NEWS.d/next/Library/2023-03-31-01-13-00.gh-issue-103143.6eMluy.rst [new file with mode: 0644]