From 975bd960fd07e75799b8e3adc4c0033046b34792 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 26 Aug 2026 19:58:45 -0400 Subject: feat: language and option fields in tui, context-sensitive voice label --- audiobook.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'audiobook.py') diff --git a/audiobook.py b/audiobook.py index 5569070..f95e1d3 100755 --- a/audiobook.py +++ b/audiobook.py @@ -371,11 +371,14 @@ Examples: if args.backend != BACKEND_AUDIOCPP: parser.error("--option requires --backend audiocpp; the options " "are passed through to the audio.cpp model") - for item in args.option: - key, sep, value = item.partition("=") - if not sep or not key.strip(): - parser.error(f"--option expects KEY=VALUE (got {item!r})") - request_options[key.strip()] = value + from backends.common import parse_request_options + try: + # Joined with spaces so both "--option a=1 --option b=2" and a + # single quoted "a=1, b=2" parse identically (the shared parser + # splits on commas or whitespace). + request_options = parse_request_options(" ".join(args.option)) + except ValueError as exc: + parser.error(str(exc)) api_url = None if args.api_url is not None: -- cgit v1.2.3