public SubmitJob(String[] args) throws ParseException {
    CommandLineParser parser = new PosixParser();
    CommandLine commandLine = parser.parse(getOptions(), args);

    if(commandLine.hasOption("loop")) {
      numIterations_ = Integer.parseInt(commandLine.getOptionValue("loop"));
    } else {
      numIterations_ = 1;
    }

    String key = commandLine.getOptionValue("key");
    String secret = commandLine.getOptionValue("secret");
    String host = commandLine.getOptionValue("host");

    String jobTypeString = commandLine.getOptionValue("job-type");

    /*
     * Turn the job type String into something that the JobType cand
     * understand.
     */
    String sanitizedJobTypeString = jobTypeString.toUpperCase().replace('-', '_');
    jobType_ = JobType.valueOf(sanitizedJobTypeString);

    if(commandLine.hasOption("image-file")) {
      String imageFileName = commandLine.getOptionValue("image-file");
      imageUrls_ = new ArrayList<String>();

      try {
        BufferedReader imageFileReader = new BufferedReader(new FileReader(imageFileName));
        String line;
        while((line = imageFileReader.readLine()) != null) {
          imageUrls_.add(line.trim());
        }
      } catch(IOException e) {
        throw new RuntimeException(e);
      }
    }

    if(commandLine.hasOption("song")) {
      songUrl_ = commandLine.getOptionValue("song");
    }

    client_ = new ApiClient(key, secret, host);

    if(jobType_ == JobType.DIRECT_AND_RENDER) {
      if(songUrl_ == null) {
        throw new MissingArgumentException("must specify a song for " + jobTypeString + " jobs");
      }

      if(imageUrls_ == null) {
        throw new MissingArgumentException("must specify images for " + jobTypeString + " jobs");
      }
    } else {
      throw new UnrecognizedOptionException("code needs to be added for job type " + jobTypeString);
    }
  }