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 | |
parent | 2b38463868b5acf9b1d64fb480aba683fe56d6d7 (diff) | |
download | cmd2-git-0d2afb71eb66a602678056a55b2a7a416116a957.tar.gz |
Fixed bug where was sometimes showing raw and expanded commands when they weren't different
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | cmd2/history.py | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 24697a77..47e48406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.9.15 (July TBD, 2019) * Bug Fixes * Fixed exception caused by tab completing after an invalid subcommand was entered + * Fixed bug where `history -v` was sometimes showing raw and expanded commands when they weren't different * Enhancements * Greatly simplified using argparse-based tab completion. The new interface is a complete overhaul that breaks the previous way of specifying completion and choices functions. See header of [argparse_custom.py](https://github.com/python-cmd2/cmd2/blob/master/cmd2/argparse_custom.py) 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() |