mirror of
https://github.com/onyx-and-iris/slobs-cli.git
synced 2025-06-27 15:20:24 +01:00
add --version/-v flag
This commit is contained in:
parent
cb0a87df68
commit
e7a561c7b4
10
CHANGELOG.md
10
CHANGELOG.md
@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
# [0.7.6] - 2025-06-11
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- --version/-v command.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- --token/-t is now required.
|
||||||
|
|
||||||
# [0.7.3] - 2025-06-10
|
# [0.7.3] - 2025-06-10
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -46,6 +46,7 @@ The CLI should now be discoverable as `slobs-cli`
|
|||||||
- --domain/-d: Streamlabs client domain
|
- --domain/-d: Streamlabs client domain
|
||||||
- --port/-p Streamlabs client port
|
- --port/-p Streamlabs client port
|
||||||
- --token/-t: API Token
|
- --token/-t: API Token
|
||||||
|
- --version/-v: Print the slobs-cli version
|
||||||
|
|
||||||
Pass `--domain`, `--port` and `--token` as flags on the root command, for example:
|
Pass `--domain`, `--port` and `--token` as flags on the root command, for example:
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "slobs-cli"
|
name = "slobs-cli"
|
||||||
version = "0.7.5"
|
|
||||||
description = "A command line application for Streamlabs Desktop"
|
description = "A command line application for Streamlabs Desktop"
|
||||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||||
dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"]
|
dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"]
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
slobs-cli = "slobs_cli.cli:run"
|
slobs-cli = "slobs_cli.cli:run"
|
||||||
@ -19,6 +19,10 @@ build-backend = "pdm.backend"
|
|||||||
[tool.pdm]
|
[tool.pdm]
|
||||||
distribution = true
|
distribution = true
|
||||||
|
|
||||||
|
[tool.pdm.version]
|
||||||
|
source = "file"
|
||||||
|
path = "src/slobs_cli/__about__.py"
|
||||||
|
|
||||||
[tool.pdm.scripts]
|
[tool.pdm.scripts]
|
||||||
cli.cmd = "slobs-cli {args}"
|
cli.cmd = "slobs-cli {args}"
|
||||||
cli.env_file = ".env"
|
cli.env_file = ".env"
|
||||||
@ -28,8 +32,4 @@ test.env_file = ".env"
|
|||||||
post_test.cmd = "python tests/teardown.py"
|
post_test.cmd = "python tests/teardown.py"
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = [
|
dev = ["tox-pdm>=0.7.2", "pytest>=8.4.0", "virtualenv-pyenv>=0.5.0"]
|
||||||
"tox-pdm>=0.7.2",
|
|
||||||
"pytest>=8.4.0",
|
|
||||||
"virtualenv-pyenv>=0.5.0",
|
|
||||||
]
|
|
||||||
|
1
src/slobs_cli/__about__.py
Normal file
1
src/slobs_cli/__about__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
__version__ = "0.7.6"
|
@ -2,6 +2,8 @@ import anyio
|
|||||||
import asyncclick as click
|
import asyncclick as click
|
||||||
from pyslobs import ConnectionConfig, SlobsConnection
|
from pyslobs import ConnectionConfig, SlobsConnection
|
||||||
|
|
||||||
|
from .__about__ import __version__ as version
|
||||||
|
|
||||||
|
|
||||||
@click.group()
|
@click.group()
|
||||||
@click.option(
|
@click.option(
|
||||||
@ -30,6 +32,9 @@ from pyslobs import ConnectionConfig, SlobsConnection
|
|||||||
show_envvar=True,
|
show_envvar=True,
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
|
@click.version_option(
|
||||||
|
version, "-v", "--version", message="%(prog)s version: %(version)s"
|
||||||
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def cli(ctx: click.Context, domain: str, port: int, token: str | None):
|
async def cli(ctx: click.Context, domain: str, port: int, token: str | None):
|
||||||
"""Command line interface for Streamlabs Desktop."""
|
"""Command line interface for Streamlabs Desktop."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user