code: private static boolean optionExist(String args[], String opt) {
      for (String arg : args) {
        if (arg.equalsIgnoreCase(opt)) {
          return true;
        }
      }
      return false;
    }
docs: Check if the option exist in the given arguments.