diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-06-07 01:34:19 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-06-07 01:34:19 -0400 |
commit | dbeef111ca56b5b74eae20a2e0915e87f842829b (patch) | |
tree | ff6cc087cc6ca446b5afe6e995eb6ace164841aa | |
parent | 794414745f7c28c4c96300117ce9a57c38d4d5b5 (diff) | |
download | cmd2-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)
-rw-r--r-- | cmd2/cmd2.py | 2 |
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+") |