Skip to content

Commit be40449

Browse files
committed
Mention emptyline behavior under default() documentation.
1 parent 3ad49f9 commit be40449

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/cmd.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ When the user enters an empty line in response to the prompt, ``Cmd`` does
9999
**not** ignore the input by default. Instead, it repeats the last non-empty
100100
command entered.
101101

102-
This behavior is implemented by :meth:`Cmd.emptyline`. Subclasses that do not
102+
This behavior is implemented by :meth:`emptyline`. Subclasses that do not
103103
want empty input to repeat the previous command should override
104-
:meth:`Cmd.emptyline` to do nothing::
104+
:meth:`emptyline` to do nothing::
105105

106106
def emptyline(self):
107107
pass
@@ -139,6 +139,8 @@ want empty input to repeat the previous command should override
139139
Method called on an input line when the command prefix is not recognized. If
140140
this method is not overridden, it prints an error message and returns.
141141

142+
Note that if :meth:`emptyline` is not overridden, empty input may cause
143+
the previous command to be repeated and passed again to this method.
142144

143145
.. method:: Cmd.completedefault(text, line, begidx, endidx)
144146

0 commit comments

Comments
 (0)