Skip to content

Commit 05d366d

Browse files
miss-islingtonmangrisanoStanFromIreland
authored
[3.14] gh-58083: Expand the introduction of the cmd module (GH-155738) (#160439)
(cherry picked from commit fd8f475) Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 0782e92 commit 05d366d

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
@@ -15,6 +15,13 @@ command interpreters. These are often useful for test harnesses, administrative
1515
tools, and prototypes that will later be wrapped in a more sophisticated
1616
interface.
1717

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

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

0 commit comments

Comments
 (0)