mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-20 16:03:38 +00:00
Compare commits
6 Commits
add-styles
...
55a7da67db
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a7da67db | |||
| 7bec573ef9 | |||
| 55e60ff977 | |||
| 922efddf7a | |||
| 4a0147aa8a | |||
| cec76df1d1 |
@@ -5,6 +5,15 @@ 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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
# [0.18.0] - 2025-06-21
|
||||
|
||||
### Added
|
||||
|
||||
- Various colouring styles, see [Style](https://github.com/onyx-and-iris/obsws-cli/tree/main?tab=readme-ov-file#style)
|
||||
- colouring is applied to list tables as well as highlighted information in stdout/stderr output.
|
||||
- table border styling may be optionally disabled with the --no-border flag.
|
||||
|
||||
|
||||
# [0.17.3] - 2025-06-20
|
||||
|
||||
### Added
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = "0.17.6"
|
||||
__version__ = "0.18.3"
|
||||
|
||||
@@ -7,7 +7,7 @@ from typing import Annotated
|
||||
import obsws_python as obsws
|
||||
import typer
|
||||
|
||||
from obsws_cli.__about__ import __version__ as obsws_cli_version
|
||||
from obsws_cli.__about__ import __version__ as version
|
||||
|
||||
from . import console, settings, styles
|
||||
from .alias import RootTyperAliasGroup
|
||||
@@ -37,7 +37,7 @@ for sub_typer in (
|
||||
def version_callback(value: bool):
|
||||
"""Show the version of the CLI."""
|
||||
if value:
|
||||
console.out.print(f'obsws-cli version: {obsws_cli_version}')
|
||||
console.out.print(f'obsws-cli version: {version}')
|
||||
raise typer.Exit()
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,9 @@ def list_(ctx: typer.Context):
|
||||
for profile in resp.profiles:
|
||||
table.add_row(
|
||||
profile,
|
||||
util.check_mark(profile == resp.current_profile_name, empty_if_false=True),
|
||||
util.check_mark(
|
||||
ctx, profile == resp.current_profile_name, empty_if_false=True
|
||||
),
|
||||
)
|
||||
|
||||
console.out.print(table)
|
||||
|
||||
@@ -21,9 +21,9 @@ class Style:
|
||||
|
||||
name: str = 'no_colour'
|
||||
description: str = 'Style disabled'
|
||||
border: str | None = None
|
||||
column: str | None = None
|
||||
highlight: str | None = None
|
||||
border: str = 'none'
|
||||
column: str = 'none'
|
||||
highlight: str = 'none'
|
||||
no_border: bool = False
|
||||
|
||||
def __post_init__(self):
|
||||
|
||||
@@ -13,6 +13,10 @@ def check_mark(value: bool, empty_if_false: bool = False) -> str:
|
||||
if empty_if_false and not value:
|
||||
return ''
|
||||
|
||||
# rich gracefully handles the absence of colour throughout the rest of the application,
|
||||
# but here we must handle it manually.
|
||||
# If NO_COLOR is set, we return plain text symbols.
|
||||
# Otherwise, we return coloured symbols.
|
||||
if os.getenv('NO_COLOR', '') != '':
|
||||
return '✓' if value else '✗'
|
||||
return '✅' if value else '❌'
|
||||
|
||||
Reference in New Issue
Block a user