code: public List<Entry> parse(String[] argv) {
          optind = -1;
  
          List<Entry> ret = new ArrayList<Entry>();
  
          int idx = 0;
          while (idx < argv.length) {
              if (argv[idx].equals("--")) {
                  // End of options!
                  ++idx;
                  break;
              }
  
              if (argv[idx].charAt(0) != '-') {
                  // End of options
                  break;
              }
  
  
              if (argv[idx].startsWith("--")) {
                  idx = parseLongOption(argv, ret, idx);
              } else if (argv[idx].startsWith("-")) {
                  idx = parseShortOption(argv, ret, idx);
              } else {
                  break;
              }
              ++idx;
          }
  
          if (idx != argv.length) {
              optind = idx;
          }
  
          return ret;
      }
docs: Parse the given hasArgument vector
  
  @param argv The arguments to parse
  @return The user-specified options