From 7a4ff3278d800fef1321b891ad9d77f30da4752e Mon Sep 17 00:00:00 2001 From: Michele Angrisano Date: Thu, 13 Aug 2026 19:15:10 +0200 Subject: [PATCH] gh-58083: Expand the introduction of the cmd module --- Doc/library/cmd.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst index c988fcebd68a019..f4675c2fb58a8c5 100644 --- a/Doc/library/cmd.rst +++ b/Doc/library/cmd.rst @@ -13,6 +13,13 @@ command interpreters. These are often useful for test harnesses, administrative tools, and prototypes that will later be wrapped in a more sophisticated interface. +A command interpreter built with :class:`Cmd` presents the user with an +interactive prompt, reads input one line at a time, and runs each command by +calling the method whose name matches it. For example, the ``help`` command is +handled by a ``do_help()`` method. Apart from the built-in ``help`` command, +the interpreter's behavior is defined by the ``do_*`` methods you add in your +own subclass. + .. class:: Cmd(completekey='tab', stdin=None, stdout=None) A :class:`Cmd` instance or subclass instance is a line-oriented interpreter