diff --git a/obsws_cli/__about__.py b/obsws_cli/__about__.py index e9f816b..0bb7925 100644 --- a/obsws_cli/__about__.py +++ b/obsws_cli/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2025-present onyx-and-iris # # SPDX-License-Identifier: MIT -__version__ = "0.6.6" +__version__ = "0.6.7" diff --git a/obsws_cli/alias.py b/obsws_cli/alias.py index e3e13e6..8706a93 100644 --- a/obsws_cli/alias.py +++ b/obsws_cli/alias.py @@ -10,6 +10,11 @@ class AliasGroup(typer.core.TyperGroup): _CMD_SPLIT_P = re.compile(r' ?[,|] ?') + def __init__(self, *args, **kwargs): + """Initialize the AliasGroup.""" + super().__init__(*args, **kwargs) + self.no_args_is_help = True + def get_command(self, ctx, cmd_name): """Get a command by name.""" cmd_name = self._group_cmd_name(cmd_name) diff --git a/obsws_cli/app.py b/obsws_cli/app.py index e1e8f80..b01efc7 100644 --- a/obsws_cli/app.py +++ b/obsws_cli/app.py @@ -9,6 +9,7 @@ from pydantic import ConfigDict from pydantic_settings import BaseSettings from . import group, input, record, scene, scenecollection, sceneitem, stream +from .alias import AliasGroup class Settings(BaseSettings): @@ -29,7 +30,7 @@ class Settings(BaseSettings): TIMEOUT: int = 5 # Timeout for requests in seconds -app = typer.Typer() +app = typer.Typer(cls=AliasGroup) app.add_typer(scene.app, name='scene') app.add_typer(sceneitem.app, name='scene-item') app.add_typer(group.app, name='group') diff --git a/pyproject.toml b/pyproject.toml index ae33594..dce1bcc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ obsws-cli = "obsws_cli:app" path = "obsws_cli/__about__.py" [tool.hatch.envs.default.scripts] -cli = "obsws-cli {args:obsws_cli}" +cli = "obsws-cli {args:}" test = "pytest {args:obsws_cli tests}" [tool.hatch.envs.hatch-test]