热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

joptsimple.OptionDescriptor.requiresArgument()方法的使用及代码示例

本文整理了Java中joptsimple.OptionDescriptor.requiresArgument()方法的一些代码示例,展示了OptionDes

本文整理了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() );
}
}

推荐阅读
author-avatar
圣峰冰寒_869
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有