@Override protected void processOption(String arg, ListIterator iter) throws ParseException { if(getOptions().hasOption(arg)) { super.processOption(arg, iter); } } };
@Override protected void processOption(String arg0, @SuppressWarnings("rawtypes") ListIterator arg1) throws ParseException { if (getOptions().hasOption(arg0)){ super.processOption(arg0, arg1); } } }
@Override @SuppressWarnings("rawtypes") protected void processOption(String arg, ListIterator iter) throws ParseException { boolean hasOption = getOptions().hasOption(arg); if (hasOption) { super.processOption(arg, iter); } } }
/** * Modifies the original method to bypass (for convenience) options not * defined in the {@code Options} object. * * @param arg The {@code String} value representing an {@code Option} * @param iter The iterator over the flattened command line arguments * @since 0.2.2 */ protected void processOption(String arg, ListIterator iter) { boolean hasOption = this.getOptions().hasOption(arg); if (!hasOption) return; try { super.processOption(arg, iter); } catch(Throwable e) { throw new RuntimeException(e); } }
/** * Given an argument string and an iterator, try to process the option, respecting the * ignoreUnrecognizedOption flag. * * @param arg the argument to process * @param iter the iterator for the super class to deal with * @throws ParseException on any problems */ @Override protected void processOption(final String arg, final ListIterator iter) throws ParseException { boolean hasOption = getOptions().hasOption(arg); if (hasOption || !ignoreUnrecognizedOption) { super.processOption(arg, iter); } } }