X-Git-Url: https://git.xandkar.net/?p=khome.git;a=blobdiff_plain;f=home%2Fbin%2Ferlcode-find-calls;h=ad1884ead22d6b96591e518dcf96bcdbf68d42dc;hp=0fb49c98fee3c55f6dd2805a30a4ee4c44145fa5;hb=6a53be4cddcb92dc367f8100eec7847c60f1d308;hpb=c10264d1d27f36de9a2536d8db50574f07919bd5 diff --git a/home/bin/erlcode-find-calls b/home/bin/erlcode-find-calls index 0fb49c9..ad1884e 100755 --- a/home/bin/erlcode-find-calls +++ b/home/bin/erlcode-find-calls @@ -38,16 +38,18 @@ find $dirs -type f -name '*.erl' -exec grep -Hn "\<$target_module\>:" '{}' \; \ print "group-by-caller" for (caller_module_file in Caller_modules) { printf "%s%s\n", indent, caller_module_file; + sort = "sort -n -k 2 -r | column -t | sed \"s/^/" indent indent "/\"" for (cf in Calls_from) { split(cf, call, SUBSEP); if (call[1] == caller_module_file) - printf "%s%s %d\n", indent indent, call[2], Calls_from[cf] | "sort"; + printf "%s %d\n", call[2], Calls_from[cf] | sort; } - close("sort") + close(sort) } print "all" + sort = "sort -n -k 2 -r | column -t | sed \"s/^/" indent "/\"" for (called_function in Calls) - printf "%s%s %d\n", indent, called_function, Calls[called_function] | "sort" - close("sort") + printf "%s %d\n", called_function, Calls[called_function] | sort + close(sort) }'