Bound indexed retrieval operations
This commit is contained in:
parent
ad4f52b239
commit
c69cd16515
6 changed files with 208 additions and 46 deletions
|
|
@ -53,6 +53,7 @@ def _parser() -> argparse.ArgumentParser:
|
|||
command.add_argument("--relation")
|
||||
else:
|
||||
command.add_argument("--depth", type=int, default=2)
|
||||
command.add_argument("--limit", type=int)
|
||||
context = commands.add_parser("context")
|
||||
context.add_argument("profile")
|
||||
context.add_argument("--budget", type=int)
|
||||
|
|
@ -149,11 +150,23 @@ def _run(arguments: argparse.Namespace) -> dict[str, object]:
|
|||
limit=arguments.limit,
|
||||
)
|
||||
if arguments.command == "backlinks":
|
||||
return index.backlinks(arguments.node_id, relation=arguments.relation)
|
||||
return index.backlinks(
|
||||
arguments.node_id,
|
||||
relation=arguments.relation,
|
||||
limit=arguments.limit,
|
||||
)
|
||||
if arguments.command == "dependencies":
|
||||
return index.dependencies(arguments.node_id, depth=arguments.depth)
|
||||
return index.dependencies(
|
||||
arguments.node_id,
|
||||
depth=arguments.depth,
|
||||
limit=arguments.limit,
|
||||
)
|
||||
if arguments.command == "impact":
|
||||
return index.impact(arguments.node_id, depth=arguments.depth)
|
||||
return index.impact(
|
||||
arguments.node_id,
|
||||
depth=arguments.depth,
|
||||
limit=arguments.limit,
|
||||
)
|
||||
if arguments.command == "context":
|
||||
return compile_context(index, arguments.profile, arguments.budget)
|
||||
if arguments.command == "render":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue