diff --git a/src/slobs_cli/cli.py b/src/slobs_cli/cli.py index 5102899..d3c4441 100644 --- a/src/slobs_cli/cli.py +++ b/src/slobs_cli/cli.py @@ -4,6 +4,7 @@ import anyio import asyncclick as click from pyslobs import ConnectionConfig, SlobsConnection +from . import styles from .__about__ import __version__ as version @@ -34,11 +35,32 @@ from .__about__ import __version__ as version required=True, help='The token for the SLOBS server.', ) +@click.option( + '-s', + '--style', + default='disabled', + envvar='SLOBS_STYLE', + show_default=True, + show_envvar=True, + help='The style to use for output.', +) +@click.option( + '-b', + '--no-border', + is_flag=True, + default=False, + envvar='SLOBS_STYLE_NO_BORDER', + show_default=True, + show_envvar=True, + help='Disable borders in the output.', +) @click.version_option( version, '-v', '--version', message='%(prog)s version: %(version)s' ) @click.pass_context -async def cli(ctx: click.Context, domain: str, port: int, token: str): +async def cli( + ctx: click.Context, domain: str, port: int, token: str, style: str, no_border: bool +): """Command line interface for Streamlabs Desktop.""" ctx.ensure_object(dict) config = ConnectionConfig( @@ -47,6 +69,7 @@ async def cli(ctx: click.Context, domain: str, port: int, token: str): token=token, ) ctx.obj['connection'] = SlobsConnection(config) + ctx.obj['style'] = styles.request_style_obj(style, no_border) def run():