summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-24 17:18:46 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-24 17:18:46 -0400
commit5d8ac434ec81bb50eb4e4650885f79347f302cca (patch)
tree20a7a7cd5d457590c6c456d6aa89c877162893d4 /cmd2/cmd2.py
parent57813276d9de0b368d1390f22e4e04b0f57246a7 (diff)
downloadcmd2-git-5d8ac434ec81bb50eb4e4650885f79347f302cca.tar.gz
Allow first comment block to appear before or after :param type lines
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index efc35a3a..c2d3eb1c 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2460,15 +2460,16 @@ Usage: Usage: unalias [-a] name [name ...]
found_first = False
for doc_line in doc.splitlines():
stripped_line = doc_line.strip()
+
+ # Don't include :param type lines
if stripped_line.startswith(':'):
- # Stop since we've now hit the :param type lines
- break
+ if found_first:
+ break
elif stripped_line:
doc_block.append(stripped_line)
found_first = True
- else:
- if found_first:
- break
+ elif found_first:
+ break
for doc_line in doc_block:
self.stdout.write('{: <{col_width}}{doc}\n'.format(command,