8 find $dirs -type f
-name '*.erl' -exec grep -Hn "\<$target_module\>:" '{}' \
; \
11 -F "${target_module}:" \
12 -v target_module
="$target_module" \
13 -v target_fun_regex
="$target_fun_regex" '
15 caller_module_file = $1
16 sub(":.*$", "", caller_module_file)
19 sub("\\(.*$", "", called_function)
21 if (called_function ~ /^[a-z][a-zA-Z_0-9]+$/) {
22 # Gather full API of the target_module
23 Calls[called_function]++
25 # Gather target call sites
26 if (called_function ~ target_fun_regex) {
27 Calls_from[caller_module_file, called_function]++
28 Caller_modules[caller_module_file]++
32 "[WARN] skipped an invalid erlang function name. File: \"%s\", function: \"%s\", original line: \"%s\"\n", \
33 caller_module_file, called_function, $0 \
40 for (caller_module_file in Caller_modules) {
41 print caller_module_file;
42 for (cf in Calls_from) {
43 split(cf, call, SUBSEP);
44 if (call[1] == caller_module_file)
45 printf "%s%s\n", indent, call[2] | "sort";
51 printf "Inferred API of %s:\n", target_module
52 for (called_function in Calls)
53 printf "%s%s\n", indent, called_function | "sort"
This page took 0.059836 seconds and 4 git commands to generate.