summaryrefslogtreecommitdiff
path: root/cmd2/history.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-06-13 23:41:04 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-06-13 23:41:04 -0400
commit5635962154ac670a73c7c608f56ceb146e975f3f (patch)
tree89d88d0691046b4587f0daa4686bd0370007cb78 /cmd2/history.py
parentf64f9d559caa08b5649b9bd356af2812acf103bd (diff)
downloadcmd2-git-5635962154ac670a73c7c608f56ceb146e975f3f.tar.gz
Fix history display issues
Issues were two fold: - HistoryItem statement.raw was getting mangled for multiline commands due to macro-related changes in _input_line_to_statement() - HistoryItem pretty printing wasn't using rstrip() anymore in verbose mode I added a couple unit tests in the process of getting here. But we should add some explicit unit tests of _input_line_to_statement() for cases like: - basic single-line command - macro single-line command - multiline command
Diffstat (limited to 'cmd2/history.py')
-rw-r--r--cmd2/history.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/history.py b/cmd2/history.py
index bbeb9199..7ec4ce7b 100644
--- a/cmd2/history.py
+++ b/cmd2/history.py
@@ -44,9 +44,9 @@ class HistoryItem():
:return: pretty print string version of a HistoryItem
"""
if verbose:
- ret_str = self._listformat.format(self.idx, self.raw)
+ ret_str = self._listformat.format(self.idx, self.raw.rstrip())
if self.raw != self.expanded.rstrip():
- ret_str += self._ex_listformat.format(self.idx, self.expanded)
+ ret_str += self._ex_listformat.format(self.idx, self.expanded.rstrip())
else:
if script:
# display without entry numbers