private void parseCommandLine(String[] args) throws ParseException {
    CommandLine cl = new GnuParser().parse(OPTIONS, args);

    name = cl.getOptionValue(NAME.getLongOpt());

    findAppTimeoutMs = DEFAULT_FIND_YARN_APP_TIMEOUT_MS;
    if (cl.hasOption(FIND_APP_TIMEOUT.getLongOpt())) {
      findAppTimeoutMs = Long.parseLong(cl.getOptionValue(FIND_APP_TIMEOUT.getLongOpt())) * 1000;
    }

    if (cl.hasOption(OUTPUT_FILE.getLongOpt())) {
      outputFile = cl.getOptionValue(OUTPUT_FILE.getLongOpt());
    }

    watchMode = cl.hasOption(WATCH_MODE.getLongOpt());

    isLaunched = !cl.hasOption(NOT_LAUNCHED.getLongOpt());

    runningNodesThreshold = DEFAULT_RUNNING_NODES_THRESHOLD;
    if (cl.hasOption(RUNNING_NODES_THRESHOLD.getLongOpt())) {
      runningNodesThreshold = Float.parseFloat(cl.getOptionValue(RUNNING_NODES_THRESHOLD.getLongOpt()));
      if (runningNodesThreshold < 0.0f || runningNodesThreshold > 1.0f) {
        throw new IllegalArgumentException("Running nodes threshold value should be between 0.0 and 1.0 (inclusive)");
      }
    }

    refreshIntervalMs = DEFAULT_STATUS_REFRESH_INTERVAL_MS;
    if (cl.hasOption(REFRESH_INTERVAL.getLongOpt())) {
      long refreshIntervalSec = Long.parseLong(cl.getOptionValue(REFRESH_INTERVAL.getLongOpt()));
      if (refreshIntervalSec <= 0) {
        throw new IllegalArgumentException("Refresh interval should be >0");
      }
      refreshIntervalMs = refreshIntervalSec * 1000;
    }

    watchTimeoutMs = DEFAULT_WATCH_MODE_TIMEOUT_MS;
    if (cl.hasOption(WATCH_TIMEOUT.getLongOpt())) {
      long watchTimeoutSec = Long.parseLong(cl.getOptionValue(WATCH_TIMEOUT.getLongOpt()));
      if (watchTimeoutSec <= 0) {
        throw new IllegalArgumentException("Watch timeout should be >0");
      }
      watchTimeoutMs = watchTimeoutSec * 1000;
    }

    hiveConf = new Properties();
    if (cl.hasOption(HIVECONF.getLongOpt())) {
      hiveConf = cl.getOptionProperties(HIVECONF.getLongOpt());
    }

    isHelp = cl.hasOption(HELP.getOpt());
  }
Parses, verifies, prints and provides the command line arguments of the Llap Status program.
llap-server/src/java/org/apache/hadoop/hive/llap/cli/status/LlapStatusServiceCommandLine.java