From dbeef111ca56b5b74eae20a2e0915e87f842829b Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Thu, 7 Jun 2018 01:34:19 -0400 Subject: 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) --- cmd2/cmd2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd2') 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+") -- cgit v1.2.1