diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-05-06 10:14:08 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-05-06 10:14:08 -0400 |
commit | 14b33bb75667aef485119e4616de811e86547f69 (patch) | |
tree | 26e9218f325651e15f7e0f0751ca6e87848055fe | |
parent | 9d6ce4a5bd25742166cccd317cf9e497d1115eae (diff) | |
parent | 91e271013c8580f3308d593c2d3224ecf00d8b2f (diff) | |
download | cmd2-git-14b33bb75667aef485119e4616de811e86547f69.tar.gz |
Merge branch 'master' into argparse_error
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | cmd2/parsing.py | 4 | ||||
-rw-r--r-- | tests/test_parsing.py | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 611420dc..4967891a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 0.9.13 (TBD, 2019) +* Bug Fixes + * Fixed issue where the wrong terminator was being appended by `Statement.expanded_command_line()` * Enhancements * `pyscript` limits a command's stdout capture to the same period that redirection does. Therefore output from a command's postparsing and finalization hooks isn't saved in the StdSim object. diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 2af8a207..a9e1a52f 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -201,9 +201,7 @@ class Statement(str): def expanded_command_line(self) -> str: """Contains command_and_args plus any ending terminator, suffix, and redirection chars""" rtn = self.command_and_args - if self.multiline_command: - rtn += constants.MULTILINE_TERMINATOR - elif self.terminator: + if self.terminator: rtn += self.terminator if self.suffix: diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 5852309e..09215804 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -492,7 +492,6 @@ def test_parse_alias_on_multiline_command(parser): assert statement.args == statement assert statement == 'has > inside an unfinished command' assert statement.terminator == '' - assert statement.expanded_command_line == statement.multiline_command + ' ' + statement + MULTILINE_TERMINATOR @pytest.mark.parametrize('line,output', [ ('helpalias > out.txt', '>'), |