#include "clusterworker.h"
#include <tclap/CmdLine.h>

int main( int argc, char *argv[] )
{
  try
    {
      ///set up the command line parsing
      TCLAP::CmdLine cmd("Image alignment program", ' ', "0.001");

      TCLAP::ValueArg<std::string> listen("l", "listen", "ip to listen on", true, "", "ip");
      TCLAP::ValueArg<int> port("p", "port", "port to listen on", true, 4000, "port" );

      clusterworker cw;

      cmd.add(listen);
      cmd.add(port);

      cmd.parse(argc, argv);
      cw.init( listen.getValue(), port.getValue() );
      cw.start(0);

    }
  catch (TCLAP::ArgException &e)
    {
      std::cout << "ERROR: " << e.error() 
                << " for arg " << e.argId() << "\n";
      return 0;
    }
  return 0;
}
