diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-03-20 12:19:30 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-03-20 12:19:30 -0400 |
commit | c3e424ec69de31890ddadf67dee5fa903cbcd665 (patch) | |
tree | dcf46cb649bf9bdc095d4bcf5757c37ccfded9b6 /cmd2/cmd2.py | |
parent | 36864f4d212daf8d6e94359c08a7388c7c457f80 (diff) | |
download | cmd2-git-c3e424ec69de31890ddadf67dee5fa903cbcd665.tar.gz |
do_shell() now saves the return code of the command it runs in self.last_result for use in pyscripts
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 44e02005..630ab9b2 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3015,6 +3015,9 @@ class Cmd(cmd.Cmd): proc_reader = utils.ProcReader(proc, self.stdout, sys.stderr) proc_reader.wait() + # Save the return code of the application for use in a pyscript + self.last_result = proc.returncode + @staticmethod def _reset_py_display() -> None: """ |