if completion flag return early to avoid unnecessary VBAN connections

patch bump
This commit is contained in:
onyx-and-iris 2026-02-28 13:34:46 +00:00
parent 5460965945
commit c660778698
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
[project] [project]
name = "vban-cli" name = "vban-cli"
version = "0.4.0" version = "0.4.1"
description = "A command-line interface for Voicemeeter leveraging VBAN." description = "A command-line interface for Voicemeeter leveraging VBAN."
readme = "README.md" readme = "README.md"
license = { text = "LICENSE" } license = { text = "LICENSE" }

View File

@ -33,17 +33,17 @@ def launcher(
*tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)], *tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)],
vban_config: Annotated[VBANConfig, Parameter()] = VBANConfig(), vban_config: Annotated[VBANConfig, Parameter()] = VBANConfig(),
): ):
command, bound, _ = app.parse_args(tokens)
if tokens[0] == '--install-completion':
return command(*bound.args, **bound.kwargs)
with vban_cmd.api( with vban_cmd.api(
vban_config.kind, vban_config.kind,
ip=vban_config.host, ip=vban_config.host,
port=vban_config.port, port=vban_config.port,
streamname=vban_config.streamname, streamname=vban_config.streamname,
) as client: ) as client:
additional_kwargs = {} return command(*bound.args, **bound.kwargs, ctx=Context(client=client))
command, bound, _ = app.parse_args(tokens)
additional_kwargs['ctx'] = Context(client=client)
return command(*bound.args, **bound.kwargs, **additional_kwargs)
def run(): def run():

2
uv.lock generated
View File

@ -124,7 +124,7 @@ wheels = [
[[package]] [[package]]
name = "vban-cli" name = "vban-cli"
version = "0.4.0" version = "0.4.1"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "cyclopts" }, { name = "cyclopts" },