Skip to content

Commit f6e7d85

Browse files
committed
Fixed issue where the wrong terminator was being appended by Statement.expanded_command_line()
1 parent 4ebcf42 commit f6e7d85

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## 0.9.13 (TBD, 2019)
2+
* Bug Fixes
3+
* Fixed issue where the wrong terminator was being appended by `Statement.expanded_command_line()`
24
* Enhancements
35
* `pyscript` limits a command's stdout capture to the same period that redirection does.
46
Therefore output from a command's postparsing and finalization hooks isn't saved in the StdSim object.

cmd2/parsing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ def command_and_args(self) -> str:
201201
def expanded_command_line(self) -> str:
202202
"""Contains command_and_args plus any ending terminator, suffix, and redirection chars"""
203203
rtn = self.command_and_args
204-
if self.multiline_command:
205-
rtn += constants.MULTILINE_TERMINATOR
206-
elif self.terminator:
204+
if self.terminator:
207205
rtn += self.terminator
208206

209207
if self.suffix:

tests/test_parsing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ def test_parse_alias_on_multiline_command(parser):
492492
assert statement.args == statement
493493
assert statement == 'has > inside an unfinished command'
494494
assert statement.terminator == ''
495-
assert statement.expanded_command_line == statement.multiline_command + ' ' + statement + MULTILINE_TERMINATOR
496495

497496
@pytest.mark.parametrize('line,output', [
498497
('helpalias > out.txt', '>'),

0 commit comments

Comments
 (0)