diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-17 16:43:28 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-17 16:43:28 -0400 |
commit | 0d2afb71eb66a602678056a55b2a7a416116a957 (patch) | |
tree | b894f035ab2e4b10891ce16834d19928683c6901 /cmd2/history.py | |
parent | 2b38463868b5acf9b1d64fb480aba683fe56d6d7 (diff) | |
download | cmd2-git-0d2afb71eb66a602678056a55b2a7a416116a957.tar.gz |
Fixed bug where was sometimes showing raw and expanded commands when they weren't different
Diffstat (limited to 'cmd2/history.py')
-rw-r--r-- | cmd2/history.py | 9 |
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() |