We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fca7fec commit 4facf30Copy full SHA for 4facf30
1 file changed
Doc/library/cmd.rst
@@ -93,6 +93,18 @@ A :class:`Cmd` instance has the following methods:
93
are the beginning and ending indexes of the prefix text, which could be used to
94
provide different completion depending upon which position the argument is in.
95
96
+.. rubric:: Empty input behavior
97
+
98
+When the user enters an empty line in response to the prompt, ``Cmd`` does
99
+**not** ignore the input by default. Instead, it repeats the last non-empty
100
+command entered.
101
102
+This behavior is implemented by :meth:`Cmd.emptyline`. Subclasses that do not
103
+want empty input to repeat the previous command should override
104
+:meth:`Cmd.emptyline` to do nothing::
105
106
+ def emptyline(self):
107
+ pass
108
109
.. method:: Cmd.do_help(arg)
110
0 commit comments