summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-04 15:55:16 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-04 15:55:16 -0400
commitc4fd5b6403651ccc89976edd4e04549471b4a23b (patch)
treea254b809bc647fe80e6aff46755d9aaaa2972dc9 /cmd2/cmd2.py
parentd1438e07d48a11ef4405305277422b84cbaef06a (diff)
downloadcmd2-git-c4fd5b6403651ccc89976edd4e04549471b4a23b.tar.gz
Removed _STOP_AND_EXIT cmd2 class member since it was meant to be a boolean constant and was only used internally
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index d1a5552e..89ea0c0f 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -432,9 +432,6 @@ class Cmd(cmd.Cmd):
# Built-in commands don't make use of this. It is purely there for user-defined commands and convenience.
self._last_result = None
- # Codes used for exit conditions
- self._STOP_AND_EXIT = True # cmd convention
-
# Used load command to store the current script dir as a LIFO queue to support _relative_load command
self._script_dir = []
@@ -2859,14 +2856,15 @@ class Cmd(cmd.Cmd):
@with_argparser(ACArgumentParser(epilog=INTERNAL_COMMAND_EPILOG))
def do_eof(self, _: argparse.Namespace) -> bool:
"""Called when <Ctrl>-D is pressed"""
- # End of script should not exit app, but <Ctrl>-D should.
- return self._STOP_AND_EXIT
+ # Return True to stop the command loop
+ return True
@with_argparser(ACArgumentParser())
def do_quit(self, _: argparse.Namespace) -> bool:
"""Exit this application"""
self._should_quit = True
- return self._STOP_AND_EXIT
+ # Return True to stop the command loop
+ return True
def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]],
prompt: str = 'Your choice? ') -> str: