anchor.diff:  %%% vim: set ts=4 sts=4 sw=4 et:
   
   -define('TMP_FILENAME', "/tmp/get_implicit_deps.tmp").
  --define('ATOM_PATTERN', "[a-z]+\\w+").
   
   main([Help]) when Help =:= "?"; Help =:= "-h"; Help =:= "--help"; Help =:= "help" ->
  -    io:format("Usage:~n$0 <dirname>~n");
  +    io:format("Usage:~n$0[ <dirname>]~n");
   
   main([Dirname]) ->
       FullDirname = filename:join(cwd(), Dirname),
  -    case filelib:is_dir(FullDirname) of
  -        true ->
  +    case {filelib:is_dir(FullDirname), filelib:is_dir(Dirname)} of
  +        {true, _} ->
               parse(FullDirname);
  -        false ->
  -            case filelib:is_dir(Dirname) of
  -                true ->
  -                    parse(Dirname);
  -                false ->
  -                    io:format("Directory does not exists: ~s~n", [Dirname]),
  -                    exit(1)
  -            end
  +        {_, true} ->
  +            parse(Dirname);
  +        _ ->
  +            io:format("Directory does not exists: ~s~n", [Dirname]),
  +            exit(1)
       end;
   main([]) ->
       parse(cwd()).
   
   parse(Dirname) ->
  -    Lines = lines(Dirname),
  -    Data = data(Lines),
  -
  -    AppModules = app_modules(Data),
  -    DepsModules = deps_modules(Dirname),
  -    Functions = functions(Data),
  -    ImplicitDeps = implicit_deps(Functions, AppModules ++ DepsModules),
  -
  +    Data = data(lines(Dirname)),
  +    ImplicitDeps = implicit_deps(functions(Data), app_modules(Data) ++ deps_modules(Dirname)),
       display(ImplicitDeps).
   
   lines(Dirname) ->
  
positive.code:     lists:usort([{{list_to_atom(M), list_to_atom(F)}, File} || {{M, F}, File} <- Functions]).
  
  % private functions
  
  read_file(Filename) ->
      case file:open(Filename, [raw, binary, read, exclusive, read_ahead]) of
  
negative.code: 
  app_modules(Data) ->
      Modules = lists:foldl(fun({_File, Code}, R) ->
          case code_search(Code, module, undefined) of
              [] ->
                  R;
              [{{Module}, _}] ->
                  [Module | R]
          end
      end, [], Data),
      [list_to_atom(Module) || Module <- Modules].
  