mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
Merge pull request #31 from kennethreitz/docs
added helpful comments to click entrypoint functions
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user