7 find $dirs -type f
-name '*.erl' -exec grep -Hn "\<$target_module\>:" '{}' \
; \
9 |
awk -F "${target_module}:" -v target_module
="$target_module" '
11 caller_module_file = $1
12 sub(":.*$", "", caller_module_file)
15 sub("\\(.*$", "", called_function)
17 if (called_function ~ /^[a-z][a-zA-Z_0-9]+$/) {
18 Calls[called_function]++
19 Calls_from[caller_module_file, called_function]++
20 Caller_modules[caller_module_file]++
23 "[WARN] skipped an invalid erlang function name. File: \"%s\", function: \"%s\", original line: \"%s\"\n", \
24 caller_module_file, called_function, $0 \
31 for (caller_module_file in Caller_modules) {
32 print caller_module_file;
33 for (cf in Calls_from) {
34 split(cf, call, SUBSEP);
35 if (call[1] == caller_module_file)
36 printf "%s%s\n", indent, call[2] | "sort";
42 printf "Inferred API of %s:\n", target_module
43 for (called_function in Calls)
44 printf "%s%s\n", indent, called_function | "sort"
This page took 0.097392 seconds and 4 git commands to generate.