Improvements to JSON queries:
- Add a way to return all the modules in the transitive closure of a
given rule (instead of only their names)
- Add a way to dump all the variations that appear on the input
- Add a way to print the direct deps of a module
- Add a way to force-colorize the output
This pleasantly makes it possible to chain multiple query.sh
invocations (maybe this means that this should simply be a library, but
that's not easy to do since jq doesn't allow one to specify a file to
read and then a command to run)
Test: Manual.
Change-Id: If0d9635716cffc8411762f9fbbd7687d20bf6e32
diff --git a/json_module_graph/fullTransitiveDeps.jq b/json_module_graph/fullTransitiveDeps.jq
new file mode 100644
index 0000000..1f982cf
--- /dev/null
+++ b/json_module_graph/fullTransitiveDeps.jq
@@ -0,0 +1,10 @@
+include "library";
+
+[((moduleGraphNoVariants | removeSelfEdges) as $m |
+ [$arg] |
+ transitiveDeps($m)) as $names |
+ .[] |
+ select (IN(.Name; $names | .[]))] |
+ sort_by(.Name)
+
+