private void checkRequiredValues() throws MissingValueException { if (current != null) { if (current.acceptValue() && !commandLine.isOptionAssigned(current) && !current.isFlag()) { throw new MissingValueException(current); } } }
private void visit(String token) throws CLIException { this.token = token; if (skipParsing) { commandLine.addArgumentValue(token); } else if (token.equals("--")) { skipParsing = true; } else if (current != null && current.acceptValue() && isValue(token)) { commandLine.addRawValue(current, stripLeadingAndTrailingQuotes(token)); } else if (token.startsWith("--")) { handleLongOption(token); } else if (token.startsWith("-") && !"-".equals(token)) { handleShortAndLongOption(token); } else { handleArgument(token); } if (current != null && !commandLine.acceptMoreValues(current)) { current = null; } }
buf.append(!isNullOrEmpty(option.getLongName()) ? longOptSeparator : " "); buf.append(option.getChoices().stream().collect(Collectors.joining(", ", "{", "}"))); } else if (option.acceptValue()) { String argName = option.getArgName(); if (argName != null && argName.length() == 0) {
} else { if (option.acceptValue() && (option.getArgName() == null || option.getArgName().length() != 0)) { buff.append(isNullOrEmpty(option.getShortName()) ? getLongOptionSeparator() : " "); buff.append("<").append(option.getArgName() != null ? option.getArgName() : getArgName()).append(">");
private void checkRequiredValues() throws MissingValueException { if (current != null) { if (current.acceptValue() && !commandLine.isOptionAssigned(current) && !current.isFlag()) { throw new MissingValueException(current); } } }
private void visit(String token) throws CLIException { this.token = token; if (skipParsing) { commandLine.addArgumentValue(token); } else if (token.equals("--")) { skipParsing = true; } else if (current != null && current.acceptValue() && isValue(token)) { commandLine.addRawValue(current, stripLeadingAndTrailingQuotes(token)); } else if (token.startsWith("--")) { handleLongOption(token); } else if (token.startsWith("-") && !"-".equals(token)) { handleShortAndLongOption(token); } else { handleArgument(token); } if (current != null && !commandLine.acceptMoreValues(current)) { current = null; } }
} else { if (option.acceptValue() && (option.getArgName() == null || option.getArgName().length() != 0)) { buff.append(isNullOrEmpty(option.getShortName()) ? getLongOptionSeparator() : " "); buff.append("<").append(option.getArgName() != null ? option.getArgName() : getArgName()).append(">");
buf.append(!isNullOrEmpty(option.getLongName()) ? longOptSeparator : " "); buf.append(option.getChoices().stream().collect(Collectors.joining(", ", "{", "}"))); } else if (option.acceptValue()) { String argName = option.getArgName(); if (argName != null && argName.length() == 0) {