INNER CODE UNIT · Python
capture_help
toyota-connected/ivi-homescreen · scripts/gen_config_reference.py:358
def capture_help():
# The binary's --help is the source of truth for the CLI. Returns a fenced
# code block, or None if no binary is available (skip, don't fail).
for b in (ROOT / "cmake-build-debug/shell/homescreen",
ROOT / "build/shell/homescreen"):
if not b.exists():
continue
try:
r = subprocess.run([str(b), "--help"], capture_output=True,
text=True, timeout=15)
except Exception:
return None
# --help is program output on stdout; stderr carries startup log lines
# (e.g. the DLT/sink bring-up warnings) that are not part of the CLI
# reference, so capture stdout only.
text = r.stdout or ""
i = text.find("Usage:")
if i >= 0: