File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,18 @@ A :class:`Cmd` instance has the following methods:
9393 are the beginning and ending indexes of the prefix text, which could be used to
9494 provide different completion depending upon which position the argument is in.
9595
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
96108
97109.. method :: Cmd.do_help(arg)
98110
You can’t perform that action at this time.
0 commit comments