added helpful comments to click entrypoint functions

This commit is contained in:
rednafi
2019-11-14 13:40:48 +06:00
parent f32039e0f3
commit 29b6255c46
4 changed files with 5 additions and 0 deletions
+1
View File
@@ -9,6 +9,7 @@ import click
)
@click.option("--char", nargs=1, type=click.STRING, default="|", help="Prefix char.")
def entrypoint(*, char, read_stderr):
"""Indents and echoes string with a specific pipe."""
pipe = sys.stdin if not read_stderr else sys.stderr
+1
View File
@@ -8,6 +8,7 @@ from click.utils import strip_ansi
@click.argument("s", type=click.STRING, default=False, required=False)
@click.option("--err", is_flag=True, type=click.BOOL, default=False, help="Use stderr.")
def entrypoint(s, *, err):
"""Removes ANSI chraracters and trailing spaces from string input."""
if s is False:
s = sys.stdin.read()
+2
View File
@@ -26,6 +26,8 @@ import colorama
)
@click.option("--bold", is_flag=True, type=click.BOOL, default=False, help="Be bold.")
def entrypoint(s, *, fg, bg, bold, err, always):
"""Echoes string with specific foreground and background color."""
if always:
# Don't strip colors.
colorama.init(strip=False)
+1
View File
@@ -22,6 +22,7 @@ colorama.init(strip=False)
"--color", nargs=1, type=click.STRING, default="yellow", help="Color to use."
)
def entrypoint(s, *, char, read_stderr, no_color, color):
"""Echoes step titles in < + steptitle > format."""
pipe = sys.stdin if not read_stderr else sys.stderr
if s is False: