# HG changeset patch # User catherine@dellzilla # Date 1224012517 14400 # Node ID e4daf715fc3170c5d5db64765eef1288b5401a02 # Parent 5d241111b3d6e63216c778624a0736b08bd3b9c9 echo on diff -r 5d241111b3d6 -r e4daf715fc31 cmd2/cmd2.py --- a/cmd2/cmd2.py Mon Sep 29 13:06:07 2008 -0400 +++ b/cmd2/cmd2.py Tue Oct 14 15:28:37 2008 -0400 @@ -146,6 +146,7 @@ return result class Cmd(cmd.Cmd): + echo = False caseInsensitive = True multilineCommands = [] continuationPrompt = '> ' @@ -163,7 +164,7 @@ if not os.system('which %s' % (editor)): break - settable = ['prompt', 'continuationPrompt', 'defaultFileName', 'editor', 'caseInsensitive'] + settable = ['prompt', 'continuationPrompt', 'defaultFileName', 'editor', 'caseInsensitive', 'echo'] _TO_PASTE_BUFFER = 1 def do_cmdenvironment(self, args): self.stdout.write(""" @@ -382,6 +383,8 @@ line = self.cmdqueue.pop(0) else: line = self.pseudo_raw_input(self.prompt) + if (self.echo) and (isinstance(self.stdin, file)): + self.stdout.write(line + '\n') line = self.precmd(line) stop = self.onecmd(line) stop = self.postcmd(stop, line)