diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-23 20:49:27 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-23 20:49:27 -0400 |
commit | 652122f3c9907a652a9c3a14581bb2aef90bc996 (patch) | |
tree | 9bcb0c07c2e2cee26553a1e11a1d9dbcb7225954 /cmd2/cmd2.py | |
parent | 181cecb217dd73056b72874d225e34528d484de8 (diff) | |
download | cmd2-git-652122f3c9907a652a9c3a14581bb2aef90bc996.tar.gz |
Made last_result public and restored the initialization of it in __init__ and associated comment
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 6a518978..d44e6df4 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -423,6 +423,10 @@ class Cmd(cmd.Cmd): # True if running inside a Python script or interactive console, False otherwise self._in_py = False + # Stores results from the last command run to enable usage of results in a Python script or interactive console + # Built-in commands don't make use of this. It is purely there for user-defined commands and convenience. + self.last_result = None + # Used by run_script command to store current script dir as a LIFO queue to support _relative_run_script command self._script_dir = [] |