Blame erlang-find-requires.escript

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