Skip to content

Commit 5d8ac43

Browse files
committed
Allow first comment block to appear before or after :param type lines
1 parent 5781327 commit 5d8ac43

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmd2/cmd2.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,15 +2460,16 @@ def _print_topics(self, header: str, cmds: List[str], verbose: bool) -> None:
24602460
found_first = False
24612461
for doc_line in doc.splitlines():
24622462
stripped_line = doc_line.strip()
2463+
2464+
# Don't include :param type lines
24632465
if stripped_line.startswith(':'):
2464-
# Stop since we've now hit the :param type lines
2465-
break
2466+
if found_first:
2467+
break
24662468
elif stripped_line:
24672469
doc_block.append(stripped_line)
24682470
found_first = True
2469-
else:
2470-
if found_first:
2471-
break
2471+
elif found_first:
2472+
break
24722473

24732474
for doc_line in doc_block:
24742475
self.stdout.write('{: <{col_width}}{doc}\n'.format(command,

0 commit comments

Comments
 (0)