summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index d3411f77..39ee3396 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -12,6 +12,10 @@ Settable environment parameters
Parsing commands with `optparse` options (flags)
Redirection to file with >, >>; input from file with <
+Note that redirection with > and | will only work if `self.stdout.write()`
+is used in place of `print`. The standard library's `cmd` module is
+written to use `self.stdout.write()`,
+
- Catherine Devlin, Jan 03 2008 - catherinedevlin.blogspot.com
CHANGES:
@@ -427,7 +431,7 @@ class Cmd(cmd.Cmd):
if paramName not in self.settable:
raise NotSettableError
currentVal = getattr(self, paramName)
- val = cast(currentVal, val.strip(self.terminators))
+ val = cast(currentVal, self.parsed(val).unterminated)
setattr(self, paramName, val)
self.stdout.write('%s - was: %s\nnow: %s\n' % (paramName, currentVal, val))
except (ValueError, AttributeError, NotSettableError), e: