a3a86854e9458ada1de6d958ab77ea8064482b09
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 Calls[called_function]++
23 Calls_from[caller_module_file, called_function]++
24 Caller_modules[caller_module_file]++
27 "[WARN] skipped an invalid erlang function name. File: \"%s\", function: \"%s\", original line: \"%s\"\n", \
28 caller_module_file, called_function, $0 \
35 for (caller_module_file in Caller_modules) {
36 print caller_module_file;
37 for (cf in Calls_from) {
38 split(cf, call, SUBSEP);
39 if (call[1] == caller_module_file && call[2] ~ target_fun_regex)
40 printf "%s%s\n", indent, call[2] | "sort";
46 printf "Inferred API of %s:\n", target_module
47 for (called_function in Calls)
48 printf "%s%s\n", indent, called_function | "sort"
This page took 0.042096 seconds and 3 git commands to generate.