}
String jobTypeFlag = options.JOB_TYPE_FLAG;
String jobType = cmd.getOptionValue(jobTypeFlag, options.DEFAULT_JOBTYPE);
Job jobToRun = new com.socrata.datasync.job.IntegrationJob(userPrefs);
if(jobType.equals(Jobs.PORT_JOB.toString())) {
jobToRun = new PortJob(userPrefs);
} else if(jobType.equals(Jobs.LOAD_PREFERENCES_JOB.toString())) {
jobToRun = new LoadPreferencesJob(userPrefs);
} else if (!jobType.equals(Jobs.INTEGRATION_JOB.toString())){
System.err.println("Invalid " + jobTypeFlag + ": " + cmd.getOptionValue(jobTypeFlag) +
" (must be " + Arrays.toString(Jobs.values()) + ")");
System.exit(1);
}
if (jobToRun.validateArgs(cmd)) {
jobToRun.configure(cmd);
new SimpleIntegrationRunner(jobToRun);
} else {
printHelp();
System.exit(1);
}