diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-24 19:48:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 19:48:22 -0400 |
commit | 0269c6c4b3aed822aadef08f4c28865db58055ca (patch) | |
tree | 1a88e7661100193c4b063e3ac6f48b97cb2cbe64 /cmd2/cmd2.py | |
parent | e5e8a7954b9ace78cd49ef43c5f8d6203c227f0f (diff) | |
parent | 850b234a352d5140c5959ed9245b355e6837b529 (diff) | |
download | cmd2-git-0269c6c4b3aed822aadef08f4c28865db58055ca.tar.gz |
Merge pull request #536 from python-cmd2/help_summary
Prevent :param and :return type lines from showing in help summaries
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 546b03cd..c2d3eb1c 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2459,13 +2459,17 @@ Usage: Usage: unalias [-a] name [name ...] doc_block = [] found_first = False for doc_line in doc.splitlines(): - str(doc_line).strip() - if len(doc_line.strip()) > 0: - doc_block.append(doc_line.strip()) - found_first = True - else: + stripped_line = doc_line.strip() + + # Don't include :param type lines + if stripped_line.startswith(':'): if found_first: break + elif stripped_line: + doc_block.append(stripped_line) + found_first = True + elif found_first: + break for doc_line in doc_block: self.stdout.write('{: <{col_width}}{doc}\n'.format(command, |