summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-05-04 21:28:44 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-05-04 21:28:44 +0200
commit154d0def16256fcb0ee861ec7a47fda7aecd9d91 (patch)
treed4bb5eaaa7908876087464c024483007fe7be1cb
Initial
-rwxr-xr-xcargo-dot4
1 files changed, 4 insertions, 0 deletions
diff --git a/cargo-dot b/cargo-dot
new file mode 100755
index 0000000..571a47f
--- /dev/null
+++ b/cargo-dot
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+echo "digraph G {"
+cargo metadata --format-version=1 | jq -r '.packages[] | "\"" + .id[0:.id|index(" ")] + "\" -> \"" + .dependencies[].name + "\";"'
+echo "}"