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