private void parse(String[] args) {
    Options cliOpts = setupOptions();
    BasicParser parser = new BasicParser();
    CommandLine cl = null;
    try {
      try {
       cl = parser.parse(cliOpts, args);
      } catch (ParseException ex) {
        throw new IllegalArgumentException("args = " + Arrays.toString(args));
      }

      int newThreshold = Integer.parseInt(cl.getOptionValue("threshold", "10"));
      int iterationTime = Integer.parseInt(cl.getOptionValue("iter_len",
                                 String.valueOf(maxIterationTime/(60 * 1000))));
      maxConcurrentMoves = Integer.parseInt(cl.getOptionValue("node_par_moves",
                                     String.valueOf(MAX_NUM_CONCURRENT_MOVES)));
      moveThreads = Integer.parseInt(cl.getOptionValue("par_moves",
                                     String.valueOf(MOVER_THREAD_POOL_SIZE)));
      maxIterationTime = iterationTime * 60 * 1000L;

      threshold = checkThreshold(newThreshold);
      System.out.println("Running with threshold of " + threshold
          + " and iteration time of " + maxIterationTime + " milliseconds");
    } catch (RuntimeException e) {
      printUsage(cliOpts);
      throw e;
    }
  }
private void parse ( String [ ] args ) { Options cliOpts = setupOptions ( ) ; BasicParser parser = new BasicParser ( ) ; CommandLine cl = null ; try { try { cl = parser . parse ( cliOpts , args ) ; } catch ( ParseException ex ) { throw new IllegalArgumentException ( "args = " + Arrays . toString ( args ) ) ; } int newThreshold = Integer . parseInt ( cl . getOptionValue ( "threshold" , "10" ) ) ; int iterationTime = Integer . parseInt ( cl . getOptionValue ( "iter_len" , String . valueOf ( maxIterationTime / ( 60 * 1000 ) ) ) ) ; maxConcurrentMoves = Integer . parseInt ( cl . getOptionValue ( "node_par_moves" , String . valueOf ( MAX_NUM_CONCURRENT_MOVES ) ) ) ; moveThreads = Integer . parseInt ( cl . getOptionValue ( "par_moves" , String . valueOf ( MOVER_THREAD_POOL_SIZE ) ) ) ; maxIterationTime = iterationTime * 60 * 1000L ; threshold = checkThreshold ( newThreshold ) ; System . out . println ( "Running with threshold of " + threshold + " and iteration time of " + maxIterationTime + " milliseconds" ) ; } catch ( RuntimeException e ) { printUsage ( cliOpts ) ; throw e ; } }
parse command line arguments