Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added module name scraping script

  • Loading branch information...
commit cb77948fe118c5bd1f053e53b657fbb524bf78a5 1 parent 0edc0ab
@camlspotter camlspotter authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 scrape-modules.sh
View
28 scrape-modules.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+stdlib=`ocamlfind query unix`
+stdlib_packs=""
+
+# Package names without '.'
+for l in `ocamlfind list | sed -e 's/ .*//' | grep -v '\.'`
+do
+ dir=`ocamlfind query $l`
+ if [ "$stdlib" = "$dir" ]; then
+ stdlib_packs="$stdlib_packs $l"
+ else # skip if dir is as same as stdlib
+ echo "- $l"
+ echo "PATH:: $dir"
+ ls $dir/*.cmi 2> /dev/null | sed -e 's/.*\///g' -e 's/\.cmi//' -e 's/^./\u&/'
+ fi
+done
+
+echo "- stdlib"
+echo "# Thread realted modules are found in the next PATH spec. The others are found in the default one."
+echo "PATH:: $stdlib/threads"
+ls $stdlib/*.cmi | sed -e 's/.*\///g' -e 's/\.cmi//' -e 's/^./\u&/'
+for p in $stdlib_packs
+do
+ if [ -d "$stdlib/$p" ]; then
+ ls $stdlib/$p/*.cmi | sed -e 's/.*\///g' -e 's/\.cmi//' -e 's/^./\u&/'
+ fi
+done
Please sign in to comment.
Something went wrong with that request. Please try again.