diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-07-17 17:36:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-17 17:36:40 -0400 |
commit | 03983bb0faa35e1ba7615a380e12a54b60ebad68 (patch) | |
tree | 550f3d2ac0435dabd56eb7c8777a289b9527b729 | |
parent | 4216b823cefe2386c4ea25e2099b99372e6471ee (diff) | |
parent | ab5a11c4e355248545c392682f378d2652ecf999 (diff) | |
download | cmd2-git-03983bb0faa35e1ba7615a380e12a54b60ebad68.tar.gz |
Merge branch 'master' into integrate_legacy_documentation
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | cmd2/cmd2.py | 2 | ||||
-rw-r--r-- | cmd2/history.py | 9 |
3 files changed, 10 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 24697a77..abb440dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## 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 + * Fixed bug where multiline commands were having leading and ending spaces stripped. This would mess up quoted + strings that crossed multiple lines. * 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/cmd2.py b/cmd2/cmd2.py index 9e5f5d56..c8f2f9ff 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2204,7 +2204,7 @@ class Cmd(cmd.Cmd): else: line = 'eof' - return line.strip() + return line.rstrip('\r\n') def _cmdloop(self) -> None: """Repeatedly issue a prompt, accept input, parse an initial prefix 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() |