作者:圣峰冰寒_869 | 来源:互联网 | 2023-10-12 18:04
本文整理了Java中joptsimple.OptionDescriptor.requiresArgument()
方法的一些代码示例,展示了OptionDescriptor.requiresArgument()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OptionDescriptor.requiresArgument()
方法的具体详情如下:
包路径:joptsimple.OptionDescriptor
类名称:OptionDescriptor
方法名:requiresArgument
OptionDescriptor.requiresArgument介绍
[英]Does this option OptionSpecBuilder#withRequiredArg()?
[中]此选项是否选择SpecBuilder#withRequiredArg()?
代码示例
代码示例来源:origin: java-json-tools/json-schema-validator
@Override
public String format(final Map options)
{
final Set opts = new LinkedHashSet(
options.values());
lines.addAll(HELP_PREAMBLE);
final int helpIndex = lines.size();
StringBuilder sb;
for (final OptionDescriptor descriptor : opts) {
if (descriptor.representsNonOptions())
continue;
final Collection names = descriptor.options();
sb = new StringBuilder().append(" ")
.append(optionsToString(names));
if (descriptor.requiresArgument())
sb.append(" uri");
sb.append(": ").append(descriptor.description());
if (names.contains("help"))
lines.add(helpIndex, sb.toString());
else
lines.add(sb.toString());
}
lines.addAll(HELP_POST);
return JOINER.join(lines) + LINE_SEPARATOR;
}
代码示例来源:origin: org.openjdk.jol/jol-cli
if (d.acceptsArguments()) {
o.append(" ");
if (d.requiresArgument()) {
o.append("<");
} else {
if (d.requiresArgument()) {
o.append(">");
} else {
代码示例来源:origin: org.openjdk.jcstress/jcstress-core
if (d.acceptsArguments()) {
o.append(" ");
if (d.requiresArgument()) {
o.append("<");
} else {
if (d.requiresArgument()) {
o.append(">");
} else {
代码示例来源:origin: lumongo/lumongo
sb.append(" --");
sb.append(od.options().iterator().next());
if (!od.requiresArgument()) {
sb.append(" >");
代码示例来源:origin: io.snappydata/gemfire-util
private void addHelpLineFor( OptionDescriptor descriptor ) {
if ( descriptor.acceptsArguments() ) {
if ( descriptor.requiresArgument() )
addHelpLineWithArgument( descriptor, '<', '>' );
else
addHelpLineWithArgument( descriptor, '[', ']' );
} else {
addHelpLineFor( descriptor, "" );
}
}
代码示例来源:origin: org.apache.geode/geode-joptsimple
private void addHelpLineFor( OptionDescriptor descriptor ) {
if ( descriptor.acceptsArguments() ) {
if ( descriptor.requiresArgument() )
addHelpLineWithArgument( descriptor, '<', '>' );
else
addHelpLineWithArgument( descriptor, '[', ']' );
} else {
addHelpLineFor( descriptor, "" );
}
}
代码示例来源:origin: io.snappydata/gemfire-joptsimple
private void addHelpLineFor( OptionDescriptor descriptor ) {
if ( descriptor.acceptsArguments() ) {
if ( descriptor.requiresArgument() )
addHelpLineWithArgument( descriptor, '<', '>' );
else
addHelpLineWithArgument( descriptor, '[', ']' );
} else {
addHelpLineFor( descriptor, "" );
}
}
代码示例来源:origin: net.sf.jopt-simple/jopt-simple
/**
* Appends additional info about the given option to the given buffer.
*
* This implementation:
*
* - calls {@link #extractTypeIndicator(OptionDescriptor)} for the descriptor
* - calls {@link joptsimple.OptionDescriptor#argumentDescription()} for the descriptor
* - if either of the above is present, calls
* {@link #appendOptionHelp(StringBuilder, String, String, boolean)}
*
*
* @param buffer string buffer
* @param descriptor a descriptor for a configured option of a parser
*/
protected void maybeAppendOptionInfo( StringBuilder buffer, OptionDescriptor descriptor ) {
String indicator = extractTypeIndicator( descriptor );
String description = descriptor.argumentDescription();
if ( descriptor.acceptsArguments()
|| !isNullOrEmpty( description )
|| descriptor.representsNonOptions() ) {
appendOptionHelp( buffer, indicator, description, descriptor.requiresArgument() );
}
}
代码示例来源:origin: jopt-simple/jopt-simple
/**
* Appends additional info about the given option to the given buffer.
*
* This implementation:
*
* - calls {@link #extractTypeIndicator(OptionDescriptor)} for the descriptor
* - calls {@link joptsimple.OptionDescriptor#argumentDescription()} for the descriptor
* - if either of the above is present, calls
* {@link #appendOptionHelp(StringBuilder, String, String, boolean)}
*
*
* @param buffer string buffer
* @param descriptor a descriptor for a configured option of a parser
*/
protected void maybeAppendOptionInfo( StringBuilder buffer, OptionDescriptor descriptor ) {
String indicator = extractTypeIndicator( descriptor );
String description = descriptor.argumentDescription();
if ( descriptor.acceptsArguments()
|| !isNullOrEmpty( description )
|| descriptor.representsNonOptions() ) {
appendOptionHelp( buffer, indicator, description, descriptor.requiresArgument() );
}
}