Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish pdb help messages and doc strings #103143

Closed
gaogaotiantian opened this issue Mar 31, 2023 · 0 comments
Closed

Polish pdb help messages and doc strings #103143

gaogaotiantian opened this issue Mar 31, 2023 · 0 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Mar 31, 2023

Feature or enhancement

Make pdb's help message less ugly.

Pitch

Currently, the help message of pdb is not pretty.

(Pdb) h a
a(rgs)
        Print the argument list of the current function.
(Pdb) 

a(rgs) is a little bit confusing by itself and the description's indentation is too long(directly from the docstring). commands is even worse.

(Pdb) h commands
commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)

The docstring for each command is not entirely unified (whether there's a space between the command and the description) and for some docstrings they don't match the documentation.

(Pdb) h enable
enable bpnumber [bpnumber ...]

is different than the documentation enable [bpnumber ...]

We can make it better and more user friendly.

Linked PRs

@gaogaotiantian gaogaotiantian added the type-feature A feature request or enhancement label Mar 31, 2023
@arhadthedev arhadthedev added the stdlib Python modules in the Lib dir label Mar 31, 2023
miss-islington pushed a commit that referenced this issue Apr 11, 2023
* 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
aisk pushed a commit to aisk/cpython that referenced this issue Apr 18, 2023
…03144)

* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants