anchor.diff:                  _ ->
                       ok = fprof:trace([start, {file, ProfileFile}])
               end,
  -            {ok, Pid} = ebucketmigrator_srv:start_link(Host, Dest, Conf1),
  -            receive
  -                {'EXIT', Pid, normal} ->
  -                    ok;
  -                {'EXIT', Pid, {badmatch, {error, econnrefused}}} ->
  -                    io:format("Failed to connect to host~n");
  -                Else ->
  -                    io:format("Unknown error ~p~n", [Else])
  -            end,
  +            ?log_debug("Starting migrator with the following args:~n(~p,~p,~p)", [Host, Dest, Conf2]),
  +            {ok, Pid} = ebucketmigrator_srv:start_link(Host, Dest, Conf2),
  +            Success =
  +                receive
  +                    {'EXIT', Pid, normal} ->
  +                        true;
  +                    {'EXIT', Pid, {badmatch, {error, econnrefused}}} ->
  +                        io:format("Failed to connect to host~n"),
  +                        false;
  +                    Else ->
  +                        io:format("Unknown error ~p~n", [Else]),
  +                        false
  +                end,
               case ProfileFile of
                   undefined ->
                       ok;
                   _ ->
                       fprof:trace([stop])
  +            end,
  +            case Success of
  +                true ->
  +                    ok;
  +                _ ->
  +                    %% would like some good way to sync in-flight logs
  +                    %% messages. Little evil sleep will do ok here.
  +                    timer:sleep(200),
  +                    erlang:halt(1)
               end
       end.
  
positive.code: main(["-h"]) ->
      io:format(usage());
  
  main(Args) ->
      Opts = parse(Args, []),
      run(Opts).
  
negative.code: usage() ->
      "Usage: ebucketmigrator -h host:port -b # -d desthost:destport~n"
          "\t-h host:port Connect to host:port~n"
          %% "\t-A           Use TAP acks~n"
          "\t-t           Move buckets from a server to another server (same as -V)~n"
          "\t-b #         Operate on vbucket number #~n"
          "\t-a auth      Try to authenticate as user <auth> (password is then read from stdin)~n"
          "\t-d host:port Send all vbuckets to this server~n"
          "\t--bucket-name name send select_bucket on both ends before proceeding~n"
          "\t              (normally not needed with auth)~n"
          "\t-v           set loglevel to debug~n"
          %% "\t-F           Flush all data on the destination~n"
          %% "\t-N name      Use a tap stream named \"name\"~n"
          "\t-T timeout   Terminate if nothing happened for timeout seconds~n"
          %% "\t-e           Run as an Erlang port~n"
          "\t-V           Validate bucket takeover~n"
          %% "\t-E expiry    Reset the expiry of all items to 'expiry'.~n"
          %% "\t-f flag      Reset the flag of all items to 'flag'.~n"
          "\t-p filename  Profile the server with output to filename.~n".
  
  
  