summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-05-06 03:22:21 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-05-06 03:22:21 -0400
commitf6e7d85cb3cd36e566bbd9c6c4178f70afc4acd7 (patch)
tree433ab996f0134fdf5b327ea396e69ce850e93378
parent4ebcf42f7fe51216019699b1a9edf2af4f3cb7b6 (diff)
downloadcmd2-git-f6e7d85cb3cd36e566bbd9c6c4178f70afc4acd7.tar.gz
Fixed issue where the wrong terminator was being appended by Statement.expanded_command_line()
-rw-r--r--CHANGELOG.md2
-rw-r--r--cmd2/parsing.py4
-rw-r--r--tests/test_parsing.py1
3 files changed, 3 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e5142c9b..71feca67 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', '>'),