From a1ce5070ed97e90c5946b82496d33952ab3b821c Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 2 Aug 2019 01:46:58 -0400 Subject: Fixed inconsistent parsing/tab completion behavior based on the value of `allow_redirection`. This flag is only meant to be a security setting that prevents redirection of stdout and should not alter parsing logic. --- cmd2/parsing.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) mode change 100644 => 100755 cmd2/parsing.py (limited to 'cmd2/parsing.py') diff --git a/cmd2/parsing.py b/cmd2/parsing.py old mode 100644 new mode 100755 index db085f5f..707140f7 --- 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 = [] -- cgit v1.2.1