mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-13 15:40:05 +00:00
fix(cli): list prs, provider, and export formats in --help
graphify --help omitted the real prs and provider commands and the export format list. Add them (verbatim from the dispatcher's own usage text), so every listed command/format exists and the export formats match the supported allow-list.
This commit is contained in:
1 parent
8b3f1911b2
commit
aa5fef0c09
2 files changed
+54
No files matched your search
@@ -565,6 +565,7 @@ def _run_cli() -> None:
|
||||
print(" --top N how many to show (default 10)")
|
||||
print(" --graph <path> path to graph.json (default graphify-out/graph.json)")
|
||||
print(" --json emit JSON instead of text")
|
||||
print(" prs PR dashboard: CI state, review status, worktree mapping")
|
||||
print(" save-result save a Q&A result to graphify-out/memory/ for graph feedback loop")
|
||||
print(" --question Q the question asked")
|
||||
print(" --answer A the answer to save")
|
||||
@@ -617,13 +618,25 @@ def _run_cli() -> None:
|
||||
print(" --cargo extract crate→crate deps from Cargo.toml")
|
||||
print(" --global also merge the resulting graph into the global graph")
|
||||
print(" --as <tag> repo tag for --global (default: target directory name)")
|
||||
print(" provider [list|show|add|remove] manage custom LLM providers")
|
||||
print(" global add <graph.json> add/update a project graph in the global graph (~/.graphify/global-graph.json)")
|
||||
print(" --as <tag> repo tag (default: parent directory name)")
|
||||
print(" global remove <tag> remove a repo's nodes from the global graph")
|
||||
print(" global list list repos in the global graph")
|
||||
print(" global path print path to the global graph file")
|
||||
print(" benchmark [graph.json] measure token reduction vs naive full-corpus approach")
|
||||
print(" export html emit interactive graph.html [--graph PATH] [--labels PATH] [--node-limit N] [--no-viz]")
|
||||
print(" export callflow-html emit Mermaid-based architecture/call-flow HTML")
|
||||
print(" [GRAPH|DIR] [--graph PATH] [--labels PATH] [--report PATH] [--sections PATH] [--output HTML]")
|
||||
print(" [--lang auto|zh-CN|en] [--max-sections N] [--diagram-scale N]")
|
||||
print(" export obsidian emit Obsidian vault notes + canvas [--graph PATH] [--labels PATH] [--dir PATH]")
|
||||
print(" export wiki emit wiki markdown articles [--graph PATH] [--labels PATH]")
|
||||
print(" export svg emit graph.svg [--graph PATH] [--labels PATH]")
|
||||
print(" export graphml emit GraphML [--graph PATH]")
|
||||
print(" export neo4j emit Cypher or push to Neo4j [--graph PATH] [--push URI] [--user U] [--password P]")
|
||||
print(" (or set NEO4J_PASSWORD instead of --password to keep it off argv)")
|
||||
print(" export falkordb emit Cypher or push to FalkorDB [--graph PATH] [--push URI] [--user U] [--password P]")
|
||||
print(" (or set FALKORDB_PASSWORD instead of --password to keep it off argv)")
|
||||
print(" hook install install post-commit/post-checkout git hooks (all platforms)")
|
||||
print(" hook uninstall remove git hooks")
|
||||
print(" hook status check if git hooks are installed")
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
"""`graphify --help` must list user-facing commands that dispatch_command implements.
|
||||
|
||||
#3140: the top-level listing in graphify/__main__.py is hand-maintained and
|
||||
drifted from dispatch_command() — prs, provider, and 7 of 8 export formats
|
||||
never appeared. Precedent: #2071 / PR #2075 (one usage line + stdout assert).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
PYTHON = sys.executable
|
||||
|
||||
|
||||
def test_help_lists_prs_provider_and_export_formats():
|
||||
"""#3140: `graphify --help` must advertise prs, provider, and all export formats."""
|
||||
r = subprocess.run(
|
||||
[PYTHON, "-m", "graphify", "--help"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
assert r.returncode == 0, f"--help should exit 0: {r.stderr}"
|
||||
out = r.stdout
|
||||
assert " prs" in out, "`graphify --help` must list prs (#3140)"
|
||||
assert "provider" in out, "`graphify --help` must list provider (#3140)"
|
||||
for fmt in (
|
||||
"html",
|
||||
"callflow-html",
|
||||
"obsidian",
|
||||
"wiki",
|
||||
"svg",
|
||||
"graphml",
|
||||
"neo4j",
|
||||
"falkordb",
|
||||
):
|
||||
assert f"export {fmt}" in out, (
|
||||
f"`graphify --help` must list export {fmt} (#3140)"
|
||||
)
|
||||
# Silent hook internals — deliberately excluded from user-facing help.
|
||||
assert "hook-check" not in out
|
||||
assert "hook-guard" not in out
|
||||
Reference in new issue
Block a user