summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-04-30 13:20:44 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-04-30 13:28:50 -0400
commit3e9377adf9ff4b3dc7839d42ff74477627cf5380 (patch)
tree43f9554a1b0fb326d24a5bba45803b59ef8501e0 /cmd2/cmd2.py
parent79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255 (diff)
downloadcmd2-git-ctrl-d.tar.gz
do_eof() now just calls the quit functionctrl-d
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 418f8a4f..0a70e803 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -3684,15 +3684,16 @@ class Cmd(cmd.Cmd):
eof_parser = DEFAULT_ARGUMENT_PARSER(description="Called when Ctrl-D is pressed", epilog=INTERNAL_COMMAND_EPILOG)
@with_argparser(eof_parser)
- def do_eof(self, _: argparse.Namespace) -> bool:
- """Called when Ctrl-D is pressed"""
- # Return True to stop the command loop
- return True
+ def do_eof(self, _: argparse.Namespace) -> Optional[bool]:
+ """Called when Ctrl-D is pressed and calls quit"""
+ self.poutput()
+ # noinspection PyTypeChecker
+ return self.do_quit('')
quit_parser = DEFAULT_ARGUMENT_PARSER(description="Exit this application")
@with_argparser(quit_parser)
- def do_quit(self, _: argparse.Namespace) -> bool:
+ def do_quit(self, _: argparse.Namespace) -> Optional[bool]:
"""Exit this application"""
# Return True to stop the command loop
return True