/** * Removes the option or its group from the list of expected elements. * * @param option */ private void updateRequiredOptions(Option option) throws AlreadySelectedException { if (option.isRequired()) { expectedOpts.remove(option.getKey()); } // if the option is in an OptionGroup make that option the selected option of the group if (options.getOptionGroup(option) != null) { OptionGroup group = options.getOptionGroup(option); if (group.isRequired()) { expectedOpts.remove(group); } group.setSelected(option); } }
OptionGroup group = options.getOptionGroup(option);
OptionGroup group = options.getOptionGroup(opt); boolean selected = group != null && group.getSelected() != null;
/** * Removes the option or its group from the list of expected elements. * * @param opt */ private void updateRequiredOptions(Option opt) throws ParseException { // if the option is a required option remove the option from // the requiredOptions list if (opt.isRequired()) { getRequiredOptions().remove(opt.getKey()); } // if the option is in an OptionGroup make that option the selected // option of the group if (getOptions().getOptionGroup(opt) != null) { OptionGroup group = getOptions().getOptionGroup(opt); if (group.isRequired()) { getRequiredOptions().remove(group); } group.setSelected(opt); } } }
OptionGroup group = options.getOptionGroup(opt); boolean selected = group != null && group.getSelected() != null;
@Override public Options getOptions() { // Remove the options that specify which type of iterator this is, since // they are all scan iterators with this command. final HashSet<OptionGroup> groups = new HashSet<>(); final Options parentOptions = super.getOptions(); final Options modifiedOptions = new Options(); for (Iterator<?> it = parentOptions.getOptions().iterator(); it.hasNext();) { Option o = (Option) it.next(); if (!IteratorScope.majc.name().equals(o.getOpt()) && !IteratorScope.minc.name().equals(o.getOpt()) && !IteratorScope.scan.name().equals(o.getOpt())) { modifiedOptions.addOption(o); OptionGroup group = parentOptions.getOptionGroup(o); if (group != null) groups.add(group); } } for (OptionGroup group : groups) { modifiedOptions.addOptionGroup(group); } return modifiedOptions; }
/** * Sets the GET method if the command line has the "get" option. */ private void setMethod() { Option opt = this.options.getOption("-get"); this.method = this.options.getOptionGroup(opt).getSelected(); }
/** * Removes the option or its group from the list of expected elements. * * @param option */ private void updateRequiredOptions(Option option) throws AlreadySelectedException { if (option.isRequired()) { expectedOpts.remove(option.getKey()); } // if the option is in an OptionGroup make that option the selected option of the group if (options.getOptionGroup(option) != null) { OptionGroup group = options.getOptionGroup(option); if (group.isRequired()) { expectedOpts.remove(group); } group.setSelected(option); } }
@Override public Options getOptions() { // Remove the options that specify which type of iterator this is, since // they are all scan iterators with this command. final HashSet<OptionGroup> groups = new HashSet<>(); final Options parentOptions = super.getOptions(); final Options modifiedOptions = new Options(); for (Iterator<?> it = parentOptions.getOptions().iterator(); it.hasNext();) { Option o = (Option) it.next(); if (!IteratorScope.majc.name().equals(o.getOpt()) && !IteratorScope.minc.name().equals(o.getOpt()) && !IteratorScope.scan.name().equals(o.getOpt())) { modifiedOptions.addOption(o); OptionGroup group = parentOptions.getOptionGroup(o); if (group != null) groups.add(group); } } for (OptionGroup group : groups) { modifiedOptions.addOptionGroup(group); } return modifiedOptions; }
String oper = options.getOptionGroup(opt).getSelected(); if ("delta".equals(oper)) { isDelta = true;
OptionGroup group = options.getOptionGroup(option);
OptionGroup group = options.getOptionGroup(option);
OptionGroup group = options.getOptionGroup(option);
OptionGroup group = options.getOptionGroup(option);
OptionGroup group = options.getOptionGroup(opt); boolean selected = group != null && group.getSelected() != null;
/** * Removes the option or its group from the list of expected elements. * * @param opt */ private void updateRequiredOptions(Option opt) throws ParseException { // if the option is a required option remove the option from // the requiredOptions list if (opt.isRequired()) { getRequiredOptions().remove(opt.getKey()); } // if the option is in an OptionGroup make that option the selected // option of the group if (getOptions().getOptionGroup(opt) != null) { OptionGroup group = getOptions().getOptionGroup(opt); if (group.isRequired()) { getRequiredOptions().remove(group); } group.setSelected(opt); } } }
if (options.getOptionGroup(opt) != null) { OptionGroup group = options.getOptionGroup(opt);
if (options.getOptionGroup(opt) != null) { OptionGroup group = options.getOptionGroup(opt);
if (getOptions().getOptionGroup(opt) != null) OptionGroup group = getOptions().getOptionGroup(opt);
if (getOptions().getOptionGroup(opt) != null) OptionGroup group = getOptions().getOptionGroup(opt);