docs: static void parseArgs(String[] args) {
      int i = 0;
      while (true) {
        if (i >= args.length) {
          break;
        }
  
        String s = args[i];
        if (s.equals("-h") ||
                s.equals("help") ||
                s.equals("-help") ||
                s.equals("--help")) {
          usage();
        }
        else if (s.equals("-zk")) {
          i++; if (i >= args.length) { usage(); }
          g_zk = args[i];
        }
        else if (s.equals("-zkroot")) {
          i++; if (i >= args.length) { usage(); }
          g_zkroot = args[i];
        }
        else if (s.equals("-n") ||
                s.equals("-nodes")) {
          i++; if (i >= args.length) { usage(); }
          g_numNodes = Integer.parseInt(args[i]);
        }
        else if (s.equals("-timeout")) {
          i++; if (i >= args.length) { usage(); }
          g_cloudFormationTimeoutSeconds = Integer.parseInt(args[i]);
        }
        else if (s.equals("-start")) {
          g_start = true;
        }
        else if (s.equals("-wait")) {
          g_wait = true;
        }
        else {
          error("Unrecognized option " + s);
        }
  
        i++;
      }
  
      // Check for mandatory arguments.
      if (g_start) {
        if (g_numNodes < 1) {
          error("Number of H2O nodes must be greater than 0 (must specify -n)");
        }
      }
  
      if (g_wait) {
        if (g_numNodes != -1) {
          error("-nodes option may not be combined with -wait option");
        }
      }
  
      if (!g_start && !g_wait) {
        error("-start or -wait must be specified");
      }
    }