summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/history.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/cmd2/history.py b/cmd2/history.py
index 7ec4ce7b..0f47d542 100644
--- a/cmd2/history.py
+++ b/cmd2/history.py
@@ -48,18 +48,19 @@ class HistoryItem():
if self.raw != self.expanded.rstrip():
ret_str += self._ex_listformat.format(self.idx, self.expanded.rstrip())
else:
- if script:
- # display without entry numbers
- if expanded or self.statement.multiline_command:
- ret_str = self.expanded.rstrip()
- else:
- ret_str = self.raw.rstrip()
+ if expanded:
+ ret_str = self.expanded.rstrip()
else:
- # display a numbered list
- if expanded or self.statement.multiline_command:
- ret_str = self._listformat.format(self.idx, self.expanded.rstrip())
- else:
- ret_str = self._listformat.format(self.idx, self.raw.rstrip())
+ ret_str = self.raw.rstrip()
+
+ # In non-verbose mode, display raw multiline commands on 1 line
+ if self.statement.multiline_command:
+ ret_str = ret_str.replace('\n', ' ')
+
+ # Display a numbered list if not writing to a script
+ if not script:
+ ret_str = self._listformat.format(self.idx, ret_str)
+
return ret_str