summaryrefslogtreecommitdiff
path: root/cmd2/history.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/history.py')
-rw-r--r--cmd2/history.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd2/history.py b/cmd2/history.py
index dbc9a3a4..576ac37d 100644
--- a/cmd2/history.py
+++ b/cmd2/history.py
@@ -44,9 +44,12 @@ class HistoryItem():
:return: pretty print string version of a HistoryItem
"""
if verbose:
- ret_str = self._listformat.format(self.idx, self.raw.rstrip())
- if self.raw != self.expanded.rstrip():
- ret_str += '\n' + self._ex_listformat.format(self.idx, self.expanded.rstrip())
+ raw = self.raw.rstrip()
+ expanded = self.expanded.rstrip()
+
+ ret_str = self._listformat.format(self.idx, raw)
+ if raw != expanded:
+ ret_str += '\n' + self._ex_listformat.format(self.idx, expanded)
else:
if expanded:
ret_str = self.expanded.rstrip()