summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 "}"