Utils/Console: Special utility type documentation
[senf.git] / tools / find-doxy-source.sh
diff --git a/tools/find-doxy-source.sh b/tools/find-doxy-source.sh
new file mode 100755 (executable)
index 0000000..1d3d2e4
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+base="`dirname "$0"`"
+
+text="`echo "$1" | perl -pe 's/[^a-zA-Z0-9]+/ /g;s/^ //;s/ $//'`"
+${base}/find-sources.sh -c \
+    | xargs perl -0777ne '
+          while(m{/\*\*<?(.*?)\*/|///<?(.*?)$}smg) {
+              $t=$1||$2;
+              $t=~s/\\\S+//g;
+              $t=~s/[^a-zA-Z0-9]+/ /g;
+              print $ARGV,"\n" if $t=~m{\Q'"$text"'\E};
+          }'\
+    | sort -u