summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-06-07 01:34:19 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-06-07 01:34:19 -0400
commitdbeef111ca56b5b74eae20a2e0915e87f842829b (patch)
treeff6cc087cc6ca446b5afe6e995eb6ace164841aa /cmd2/cmd2.py
parent794414745f7c28c4c96300117ce9a57c38d4d5b5 (diff)
downloadcmd2-git-dbeef111ca56b5b74eae20a2e0915e87f842829b.tar.gz
Fix unexpected redirection behavior
New behavior: - help > name with space - redirects to a file called "name" (without the quotes) - help > "name with space" - redirects to a file called "name with space" (without the quotes)
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 2d8766f4..282d2117 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1840,7 +1840,7 @@ class Cmd(cmd.Cmd):
# REDIRECTION_APPEND or REDIRECTION_OUTPUT
if statement.output == constants.REDIRECTION_APPEND:
mode = 'a'
- sys.stdout = self.stdout = open(os.path.expanduser(statement.output_to), mode)
+ sys.stdout = self.stdout = open(os.path.expanduser(shlex.split(statement.output_to)[0]), mode)
else:
# going to a paste buffer
sys.stdout = self.stdout = tempfile.TemporaryFile(mode="w+")