Skip to content

Commit 5781327

Browse files
committed
Prevent :param and :return type lines from showing in help summaries
1 parent e5e8a79 commit 5781327

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cmd2/cmd2.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,9 +2459,12 @@ def _print_topics(self, header: str, cmds: List[str], verbose: bool) -> None:
24592459
doc_block = []
24602460
found_first = False
24612461
for doc_line in doc.splitlines():
2462-
str(doc_line).strip()
2463-
if len(doc_line.strip()) > 0:
2464-
doc_block.append(doc_line.strip())
2462+
stripped_line = doc_line.strip()
2463+
if stripped_line.startswith(':'):
2464+
# Stop since we've now hit the :param type lines
2465+
break
2466+
elif stripped_line:
2467+
doc_block.append(stripped_line)
24652468
found_first = True
24662469
else:
24672470
if found_first:

0 commit comments

Comments
 (0)