scheme: add --json flag to list-presets, --accent flag, drop :accent from preset spec
- list-presets --json outputs structured JSON with variants, modes, accents, and default_accent for accent-aware schemes - --accent flag replaces :accent shorthand in preset string - Validate --accent against variant's available accents - resolve_preset returns tuple[str, str] (scheme + variant only) - Update tests for new signature
This commit is contained in:
@@ -132,12 +132,10 @@ def list_schemes() -> dict[str, SchemeMeta]:
|
||||
return dict(SCHEMES)
|
||||
|
||||
|
||||
def resolve_preset(spec: str) -> tuple[str, str, str | None]:
|
||||
def resolve_preset(spec: str) -> tuple[str, str]:
|
||||
parts = spec.split(":")
|
||||
if len(parts) == 3:
|
||||
return parts[0], parts[1], parts[2]
|
||||
if len(parts) == 2:
|
||||
return parts[0], parts[1], None
|
||||
return parts[0], parts[1]
|
||||
if len(parts) == 1:
|
||||
return parts[0], "default", None
|
||||
raise ValueError(f"Invalid preset spec '{spec}'. Use <scheme>:<variant>[:<accent>]")
|
||||
return parts[0], "default"
|
||||
raise ValueError(f"Invalid preset spec '{spec}'. Use <scheme>:<variant>")
|
||||
|
||||
Reference in New Issue
Block a user