Skip to content

Commit 3c7437c

Browse files
JasonGrossclaude
authored andcommitted
Allow Print DependGraph to accept a list of references
Changed the command syntax from accepting a single reference to accepting a reference_list, enabling users to generate dependency graphs for multiple definitions in a single command. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b527597 commit 3c7437c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ The available commands are :
141141
Take all the objects of the specified modules and build the dependencies
142142
between them.
143143

144-
- Generate the dependencies of one objects:
144+
- Generate the dependencies of one or more objects:
145145

146-
Print DependGraph my_lemma.
146+
Print DependGraph my_lemma my_other_lemma.
147147

148-
Analyse recursively the dependencies of ``my_lemma``.
148+
Analyse recursively the dependencies of the given objects.
149149

150150
- Change the name of the generated file (default is ``graph.dpd``):
151151

graphdepend.mlg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ end = struct
243243
error (str "cannot open file: " ++ (str msg));
244244
end
245245

246-
let mk_dpds_graph opaque_access gref =
246+
let mk_dpds_graph opaque_access grefs =
247247
let graph = G.empty in
248248
let all = true in (* get all the dependencies recursively *)
249-
let graph = add_gref_list_and_dpds opaque_access graph ~all [gref] in
249+
let graph = add_gref_list_and_dpds opaque_access graph ~all grefs in
250250
Out.file graph
251251

252252
let file_graph_depend opaque_access dirlist =
@@ -280,8 +280,8 @@ END
280280
*)
281281

282282
VERNAC COMMAND EXTEND DependGraph CLASSIFIED AS QUERY STATE opaque_access
283-
| ["Print" "DependGraph" reference(ref) ] ->
284-
{ fun ~opaque_access -> mk_dpds_graph opaque_access (Nametab.global ref) }
283+
| ["Print" "DependGraph" reference_list(refs) ] ->
284+
{ fun ~opaque_access -> mk_dpds_graph opaque_access (List.map Nametab.global refs) }
285285
| ["Print" "FileDependGraph" reference_list(dl) ] ->
286286
{ fun ~opaque_access ->
287287
file_graph_depend opaque_access (List.map locate_mp_dirpath dl) }

meta.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ documentation: |
168168
Take all the objects of the specified modules and build the dependencies
169169
between them.
170170
171-
- Generate the dependencies of one objects:
172-
173-
Print DependGraph my_lemma.
174-
175-
Analyse recursively the dependencies of ``my_lemma``.
171+
- Generate the dependencies of one or more objects:
172+
173+
Print DependGraph my_lemma my_other_lemma.
174+
175+
Analyse recursively the dependencies of the given objects.
176176
177177
- Change the name of the generated file (default is ``graph.dpd``):
178178

0 commit comments

Comments
 (0)