Skip to content

Commit b2566cf

Browse files
committed
python#9111: document that do_help() looks at docstrings.
1 parent 9c491c9 commit b2566cf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/library/cmd.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ A :class:`Cmd` instance has the following methods:
7676
are the beginning and ending indexes of the prefix text, which could be used to
7777
provide different completion depending upon which position the argument is in.
7878

79-
All subclasses of :class:`Cmd` inherit a predefined :meth:`do_help`. This
79+
All subclasses of :class:`Cmd` inherit a predefined :meth:`do_help`. This
8080
method, called with an argument ``'bar'``, invokes the corresponding method
81-
:meth:`help_bar`. With no argument, :meth:`do_help` lists all available help
82-
topics (that is, all commands with corresponding :meth:`help_\*` methods), and
83-
also lists any undocumented commands.
81+
:meth:`help_bar`, and if that is not present, prints the docstring of
82+
:meth:`do_bar`, if available. With no argument, :meth:`do_help` lists all
83+
available help topics (that is, all commands with corresponding
84+
:meth:`help_\*` methods or commands that have docstrings), and also lists any
85+
undocumented commands.
8486

8587

8688
.. method:: Cmd.onecmd(str)

0 commit comments

Comments
 (0)