summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-10-02 23:54:01 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-10-02 23:54:01 -0400
commit60bf3aa5385f4c6dde6396c48262ae7d5177fd0c (patch)
treee1e377e8d96490f9c81327df792fd9434e915a6d /cmd2
parentc347ac8e56899c4662889d6a9f42afbd8d4646fd (diff)
downloadcmd2-git-60bf3aa5385f4c6dde6396c48262ae7d5177fd0c.tar.gz
Returned cmd_echo default to False except when running a Python command at the CLI
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/cmd2.py2
-rw-r--r--cmd2/pyscript_bridge.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index e75877f3..3a99aeb7 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2989,6 +2989,8 @@ class Cmd(cmd.Cmd):
if args.remainder:
full_command += ' ' + ' '.join(args.remainder)
+ # If running at the CLI, print the output of the command
+ bridge.cmd_echo = True
interp.runcode(full_command)
# If there are no args, then we will open an interactive Python console
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py
index 4434bb58..07ce7212 100644
--- a/cmd2/pyscript_bridge.py
+++ b/cmd2/pyscript_bridge.py
@@ -247,7 +247,7 @@ class PyscriptBridge(object):
def __init__(self, cmd2_app):
self._cmd2_app = cmd2_app
self._last_result = None
- self.cmd_echo = True
+ self.cmd_echo = False
def __getattr__(self, item: str):
"""