treat graphify <path> as graphify extract <path> — fix unknown command for direct path invocation

This commit is contained in:
Safi
2026-05-18 14:54:04 +01:00
parent a5eb15b880
commit 2209a9c1e8
+7
View File
@@ -2882,6 +2882,13 @@ def main() -> None:
f"est. cost (~{backend}): ${cost:.4f}"
)
elif Path(cmd).exists() or cmd in (".", "..") or cmd.startswith(("./", "../", "/", "~")):
# User ran `graphify <path>` directly — treat as `graphify extract <path>`.
# Common when following the PowerShell note in README (`graphify .`) or
# copy-pasting skill invocations without the leading slash.
sys.argv.insert(2, sys.argv[1])
sys.argv[1] = "extract"
main()
else:
print(f"error: unknown command '{cmd}'", file=sys.stderr)
print("Run 'graphify --help' for usage.", file=sys.stderr)