diff options
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 11 |
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 |