From bba2361964b1c93121c8d48a4176f3030fe34ee9 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 26 Jun 2025 08:56:32 +0100 Subject: [PATCH] add available themes to --theme help string patch bump --- README.md | 27 +++++++++++++-------------- pyproject.toml | 2 +- src/simple_recorder/cli.py | 23 +++++++++++++---------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 046ebea..adb5d2f 100644 --- a/README.md +++ b/README.md @@ -65,33 +65,32 @@ Just enter the filename and click *Start Recording*. #### Themes -Passing flags is fine, however, for example to set the theme: +However, passing flags is fine, for example to set the theme: ```console simple-recorder --theme="Light Purple" ``` -Available themes: Light Purple, Neutral Blue, Reds, Sandy Beach, Kayak, Light Blue 2, Dark Teal1 - ### CLI ```shell Usage: simple-recorder [OPTIONS] COMMAND -┏━ Subcommands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ start Start recording ┃ -┃ stop Stop recording ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ +┏━ Subcommands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ start Start recording ┃ +┃ stop Stop recording ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ -┏━ Options ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ --host OBS WebSocket host ┃ -┃ --port OBS WebSocket port ┃ -┃ --password OBS WebSocket password ┃ -┃ --theme GUI theme ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ +┏━ Options ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ --host OBS WebSocket host ┃ +┃ --port OBS WebSocket port ┃ +┃ --password OBS WebSocket password ┃ +┃ --theme GUI theme (Light Purple, Neutral Blue, Reds, Sandy Beach, ┃ +┃ Kayak, Light Blue 2) ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ``` -For example: +To launch the CLI pass any subcommand (start/stop etc...), for example: ```console simple-recorder start "File Name" diff --git a/pyproject.toml b/pyproject.toml index 72ee862..9edb0ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "simple-recorder" -version = "0.1.4" +version = "0.1.5" description = "A simple OBS recorder" authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }] dependencies = [ diff --git a/src/simple_recorder/cli.py b/src/simple_recorder/cli.py index 0b9b53a..689cb9d 100644 --- a/src/simple_recorder/cli.py +++ b/src/simple_recorder/cli.py @@ -15,18 +15,18 @@ config = ClypiConfig( ) configure(config) +themes = [ + "Light Purple", + "Neutral Blue", + "Reds", + "Sandy Beach", + "Kayak", + "Light Blue 2", +] + def theme_parser(value: str) -> str: """Parse the theme argument.""" - themes = [ - "Light Purple", - "Neutral Blue", - "Reds", - "Sandy Beach", - "Kayak", - "Light Blue 2", - "Dark Teal1", - ] if value not in themes: raise ClypiException( f"Invalid theme: {value}. Available themes: {', '.join(themes)}" @@ -42,7 +42,10 @@ class SimpleRecorder(Command): default=None, env="OBS_PASSWORD", help="OBS WebSocket password" ) theme: str = arg( - default="Reds", parser=theme_parser, env="OBS_THEME", help="GUI theme" + default="Reds", + parser=theme_parser, + env="OBS_THEME", + help=f"GUI theme ({', '.join(themes)})", ) @override