Blame erlang-find-requires.escript
|
Peter Lemenkov |
5ae82a |
#!/usr/bin/escript
|
|
Peter Lemenkov |
5ae82a |
%% -*- erlang -*-
|
|
Peter Lemenkov |
5ae82a |
|
|
Peter Lemenkov |
5ae82a |
main(EbinFiles) ->
|
|
Peter Lemenkov |
5ae82a |
lists:foreach(
|
|
Peter Lemenkov |
5ae82a |
fun(BeamFile) ->
|
|
Peter Lemenkov |
5ae82a |
try
|
|
Peter Lemenkov |
5ae82a |
{ok, {_Module, [{imports,Imports}]}} = beam_lib:chunks(BeamFile, [imports]),
|
|
Peter Lemenkov |
5ae82a |
lists:foreach( fun({ModName,ModFun,Arity})->io:format("erlang(~s:~s/~p)~n", [ModName,ModFun,Arity]) end, Imports)
|
|
Peter Lemenkov |
5ae82a |
catch
|
|
Peter Lemenkov |
5ae82a |
_:_ ->
|
|
Peter Lemenkov |
5ae82a |
ok
|
|
Peter Lemenkov |
5ae82a |
end
|
|
Peter Lemenkov |
5ae82a |
end,
|
|
Peter Lemenkov |
5ae82a |
EbinFiles);
|
|
Peter Lemenkov |
5ae82a |
|
|
Peter Lemenkov |
5ae82a |
main(_) ->
|
|
Peter Lemenkov |
5ae82a |
halt(1).
|
|
Peter Lemenkov |
5ae82a |
|