MCPcopy
hub / github.com/github/spec-kit / _parse_input_values

Function _parse_input_values

src/specify_cli/workflows/_commands.py:53–66  ·  view source on GitHub ↗

Parse repeated ``key=value`` CLI inputs into a dict. Shared by ``workflow run`` and ``workflow resume``. Exits with an error on any entry missing ``=``.

(input_values: list[str] | None)

Source from the content-addressed store, hash-verified

51
52
53def _parse_input_values(input_values: list[str] | None) -> dict[str, Any]:
54 """Parse repeated ``key=value`` CLI inputs into a dict.
55
56 Shared by ``workflow run`` and ``workflow resume``. Exits with an error
57 on any entry missing ``=``.
58 """
59 inputs: dict[str, Any] = {}
60 for kv in input_values or []:
61 if "=" not in kv:
62 console.print(f"[red]Error:[/red] Invalid input format: {kv!r} (expected key=value)")
63 raise typer.Exit(1)
64 key, _, value = kv.partition("=")
65 inputs[key.strip()] = value.strip()
66 return inputs
67
68
69def _reject_unsafe_dir(path: Path, label: str) -> None:

Callers 2

workflow_runFunction · 0.85
workflow_resumeFunction · 0.85

Calls 1

printMethod · 0.80

Tested by

no test coverage detected