Skip to content

Commit 7a4ff32

Browse files
committed
gh-58083: Expand the introduction of the cmd module
1 parent dd1194e commit 7a4ff32

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` presents the user with an
17+
interactive prompt, reads input one line at a time, and runs each command by
18+
calling the method whose name matches it. For example, the ``help`` command is
19+
handled by a ``do_help()`` method. Apart from the built-in ``help`` command,
20+
the interpreter's behavior is defined by the ``do_*`` methods you add in your
21+
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)