Main.

def main(argv):
  """Main."""
  del argv  # Unused.

  if flags.FLAGS.version:
    print("GRR worker {}".format(config_server.VERSION["packageversion"]))
    return

  config.CONFIG.AddContext(contexts.WORKER_CONTEXT,
                           "Context applied when running a worker.")

  # Initialise flows and config_lib
  server_startup.Init()

  fleetspeak_connector.Init()


  token = access_control.ACLToken(username="GRRWorker").SetUID()
  worker_obj = worker_lib.GRRWorker(token=token)
  worker_obj.Run()