Skip to content

Commit fd8f475

Browse files
gh-58083: Expand the introduction of the cmd module (#155738)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 8335bcb commit fd8f475

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Doc/library/cmd.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ command interpreters. These are often useful for test harnesses, administrative
1313
tools, and prototypes that will later be wrapped in a more sophisticated
1414
interface.
1515

16+
A command interpreter built with :class:`Cmd` typically presents the user
17+
with an interactive prompt, reads input one line at a time, and dispatches each
18+
command to a method named ``do_`` followed by the command name. For example,
19+
the ``help`` command is handled by the :meth:`~Cmd.do_help` method. Apart from
20+
the built-in ``help`` command, most of the interpreter's behavior is defined by
21+
the ``do_*`` methods you add in your own subclass.
22+
1623
.. class:: Cmd(completekey='tab', stdin=None, stdout=None)
1724

1825
A :class:`Cmd` instance or subclass instance is a line-oriented interpreter

0 commit comments

Comments
 (0)