Skip to content

Commit 92f8e3d

Browse files
committed
Updated documentation
1 parent c966480 commit 92f8e3d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd2/ansi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def ansi_safe_wcswidth(text: str) -> int:
8080

8181
def style(text: Any, *, fg: str = '', bg: str = '', bold: bool = False, underline: bool = False) -> str:
8282
"""
83-
Applies a style to text
83+
Applies styles to text
8484
8585
:param text: Any object compatible with str.format()
8686
:param fg: foreground color. Expects color names in FG_COLORS (e.g. 'lightred'). Defaults to no color.
@@ -126,7 +126,9 @@ def style(text: Any, *, fg: str = '', bg: str = '', bold: bool = False, underlin
126126
return "".join(additions) + text + "".join(removals)
127127

128128

129-
# Default styles. These can be altered to suit an application's needs.
129+
# Default styles for printing strings of various types.
130+
# These can be altered to suit an application's needs and only need to be a
131+
# function with the following structure: func(str) -> str
130132
style_success = functools.partial(style, fg='green', bold=True)
131133
style_warning = functools.partial(style, fg='lightyellow')
132134
style_error = functools.partial(style, fg='lightred')

0 commit comments

Comments
 (0)