Skip to content

Commit 4869082

Browse files
committed
Improved docstring for ppaged()
Added a couple lines to the ppaged() docstring to help explain the advantages and disadvantages of chopping vs wrapping and when it would be best to do one as opposed to the other. This should help developers understand the full potential of the ppaged() method.
1 parent e3672df commit 4869082

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ def ppaged(self, msg: str, end: str='\n', chop: bool=False) -> None:
630630
:param end: string appended after the end of the message if not already present, default a newline
631631
:param chop: True -> causes lines longer than the screen width to be chopped (truncated) rather than wrapped
632632
- truncated text is still accessible by scrolling with the right & left arrow keys
633+
- chopping is ideal for displaying wide tabular data as is done in utilities like pgcli
633634
False -> causes lines longer than the screen width to wrap to the next line
635+
- wrapping is ideal when you want to avoid users having to use horizontal scrolling
634636
WARNING: On Windows, the text always wraps regardless of what the chop argument is set to
635637
"""
636638
import subprocess

0 commit comments

Comments
 (0)