in src/main/java/org/apache/commons/cli/Parser.java [259:280]
protected void processOption(final String arg, final ListIterator<String> iter) throws ParseException {
final boolean hasOption = getOptions().hasOption(arg);
// if there is no option throw an UnrecognizedOptionException
if (!hasOption) {
throw new UnrecognizedOptionException("Unrecognized option: " + arg, arg);
}
// get the option represented by arg
final Option opt = (Option) getOptions().getOption(arg).clone();
// update the required options and groups
updateRequiredOptions(opt);
// if the option takes an argument value
if (opt.hasArg()) {
processArgs(opt, iter);
}
// set the option on the command line
cmd.addOption(opt);
}