summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py4
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 = []