public DefaultCommandLine addRawValue(Option option, String value) { if (!acceptMoreValues(option) && !option.isFlag()) { throw new CLIException("The option " + option.getName() + " does not accept value or has " + "already been set"); } if (! option.getChoices().isEmpty() && ! option.getChoices().contains(value)) { throw new InvalidValueException(option, value); } List<String> list = optionValues.get(option); if (list == null) { list = new ArrayList<>(); optionValues.put(option, list); } list.add(value); return this; }
if (!option.getChoices().isEmpty()) { buff.append(isNullOrEmpty(option.getShortName()) ? getLongOptionSeparator() : " "); buff.append(option.getChoices().stream().collect(Collectors.joining(", ", "{", "}"))); } else {
json.put("argName", obj.getArgName()); if (obj.getChoices() != null) { JsonArray array = new JsonArray(); obj.getChoices().forEach(item -> array.add(item)); json.put("choices", array);
if (!option.getChoices().isEmpty()) { buf.append(!isNullOrEmpty(option.getLongName()) ? longOptSeparator : " "); buf.append(option.getChoices().stream().collect(Collectors.joining(", ", "{", "}"))); } else if (option.acceptValue()) { String argName = option.getArgName();
public DefaultCommandLine addRawValue(Option option, String value) { if (!acceptMoreValues(option) && !option.isFlag()) { throw new CLIException("The option " + option.getName() + " does not accept value or has " + "already been set"); } if (! option.getChoices().isEmpty() && ! option.getChoices().contains(value)) { throw new InvalidValueException(option, value); } List<String> list = optionValues.get(option); if (list == null) { list = new ArrayList<>(); optionValues.put(option, list); } list.add(value); return this; }
if (!option.getChoices().isEmpty()) { buff.append(isNullOrEmpty(option.getShortName()) ? getLongOptionSeparator() : " "); buff.append(option.getChoices().stream().collect(Collectors.joining(", ", "{", "}"))); } else {
assertEquals(copy.getChoices(), option.getChoices()); assertEquals(copy.getDefaultValue(), option.getDefaultValue()); assertEquals(copy.getDescription(), option.getDescription()); assertEquals(copy.getChoices(), option.getChoices()); assertEquals(copy.getDefaultValue(), option.getDefaultValue()); assertEquals(copy.getDescription(), option.getDescription());
json.put("argName", obj.getArgName()); if (obj.getChoices() != null) { JsonArray array = new JsonArray(); obj.getChoices().forEach(item -> array.add(item)); json.put("choices", array);
if (!option.getChoices().isEmpty()) { buf.append(!isNullOrEmpty(option.getLongName()) ? longOptSeparator : " "); buf.append(option.getChoices().stream().collect(Collectors.joining(", ", "{", "}"))); } else if (option.acceptValue()) { String argName = option.getArgName();
assertEquals(copy.getChoices(), option.getChoices()); assertEquals(copy.getDefaultValue(), option.getDefaultValue()); assertEquals(copy.getDescription(), option.getDescription()); assertEquals(copy.getChoices(), option.getChoices()); assertEquals(copy.getDefaultValue(), option.getDefaultValue()); assertEquals(copy.getDescription(), option.getDescription());