summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-08-02 08:21:33 -0400
committerGitHub <noreply@github.com>2019-08-02 08:21:33 -0400
commit54e30144d153b612563a1b8e280da28f10ff22a3 (patch)
treef0916bccbcca134c1aa1b75b0db135f722d0d259 /cmd2/parsing.py
parent65875bdfc434474ecd2c019ef77fa99d3da8faf9 (diff)
parenta1ce5070ed97e90c5946b82496d33952ab3b821c (diff)
downloadcmd2-git-54e30144d153b612563a1b8e280da28f10ff22a3.tar.gz
Merge pull request #747 from python-cmd2/allow_redirection_fix
Fixed inconsistent treatment of allow_redirection
Diffstat (limited to 'cmd2/parsing.py')
-rwxr-xr-x[-rw-r--r--]cmd2/parsing.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index db085f5f..707140f7 100644..100755
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -245,7 +245,6 @@ class StatementParser:
the expansion.
"""
def __init__(self,
- allow_redirection: bool = True,
terminators: Optional[Iterable[str]] = None,
multiline_commands: Optional[Iterable[str]] = None,
aliases: Optional[Dict[str, str]] = None,
@@ -257,13 +256,11 @@ class StatementParser:
* multiline commands
* shortcuts
- :param allow_redirection: should redirection and pipes be allowed?
:param terminators: iterable containing strings which should terminate commands
:param multiline_commands: iterable containing the names of commands that accept multiline input
:param aliases: dictionary containing aliases
:param shortcuts: dictionary containing shortcuts
"""
- self.allow_redirection = allow_redirection
if terminators is None:
self.terminators = (constants.MULTILINE_TERMINATOR,)
else:
@@ -690,8 +687,7 @@ class StatementParser:
"""
punctuation = []
punctuation.extend(self.terminators)
- if self.allow_redirection:
- punctuation.extend(constants.REDIRECTION_CHARS)
+ punctuation.extend(constants.REDIRECTION_CHARS)
punctuated_tokens = []