diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-05-24 14:31:29 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-05-24 14:31:29 -0400 |
commit | da5f03fb515d0a751d356a0f664ccb4b3df83eb1 (patch) | |
tree | fcf13c46e58fc9238e7ceef794e02ba7596fb1e8 | |
parent | 1178bda4d68608a2cd6e34a6bd60639debc92cf1 (diff) | |
download | cmd2-git-da5f03fb515d0a751d356a0f664ccb4b3df83eb1.tar.gz |
Running commands from history stops if a command returns True for its stop value. The command loop will also terminate.
-rw-r--r-- | cmd2/cmd2.py | 6 | ||||
-rw-r--r-- | tests/transcripts/from_cmdloop.txt | 1 |
2 files changed, 1 insertions, 6 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index a4d84adf..51d5b5b6 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3408,11 +3408,7 @@ class Cmd(cmd.Cmd): self.perror("If this is what you want to do, specify '1:' as the range of history.", traceback_war=False) else: - # TODO: Call runcmds_plus_hooks and return its stop value - for runme in history: - self.pfeedback(runme) - if runme: - self.onecmd_plus_hooks(runme) + return self.runcmds_plus_hooks(history) elif args.edit: import tempfile fd, fname = tempfile.mkstemp(suffix='.txt', text=True) diff --git a/tests/transcripts/from_cmdloop.txt b/tests/transcripts/from_cmdloop.txt index 871b71f1..84d7f8fc 100644 --- a/tests/transcripts/from_cmdloop.txt +++ b/tests/transcripts/from_cmdloop.txt @@ -42,7 +42,6 @@ OODNIGHT, GRACIEGAY 5 set maxrepeats 5 6 say -ps --repeat=5 goodnight, Gracie (Cmd) history -r 4 -say -ps --repeat=5 goodnight, Gracie OODNIGHT, GRACIEGAY OODNIGHT, GRACIEGAY OODNIGHT, GRACIEGAY |