public ArgumentValues process(final String[] programArgs) throws UsageException {
    ArgumentHandler argHandler;
    final ArgumentValues result = new ArgumentValues();
    List<Argument> unmatched;
    List<Match> matches;

    // Find all argument matches and set postArgs
    matches = checkMatches(programArgs, result);

    // Find arguments which didnt match
    unmatched = new ArrayList<>();
    unmatched.addAll(args);
    for (Match match : matches) {
      unmatched.remove(match.getArgument());
    }

    // Error on unmatched yet required args
    for (Argument arg : unmatched) {
      if (arg.isRequired() && !arg.isDefinedInEnv()) {
        final UsageException usageException =
            new UsageException("Required argument not provided: " + arg);
        usageException.setUsage(getUsage());
        throw usageException;
      }
    }

    // Handle the arguments
    for (Match match : matches) {
      final Argument arg = match.getArgument();
      argHandler = arg.getArgumentHandler();
      if (argHandler != null) {
        argHandler.handleArgument(arg, match.getForm(), match.getParams());
      }
      result.addResult(arg, match.getParams());
    }

    return result;
  }
Process the command line arguments provided.

@param programArgs command line arguments supplied to program
@return argument values parsed out of command line
@throws UsageException when usge sucked
extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/installer/args/ArgumentProcessor.java