当前位置: 首页>>代码示例>>Java>>正文


Java Options.addOptionGroup方法代码示例

本文整理汇总了Java中org.apache.commons.cli.Options.addOptionGroup方法的典型用法代码示例。如果您正苦于以下问题:Java Options.addOptionGroup方法的具体用法?Java Options.addOptionGroup怎么用?Java Options.addOptionGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.cli.Options的用法示例。


在下文中一共展示了Options.addOptionGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOptions

import org.apache.commons.cli.Options; //导入方法依赖的package包/类
private static Options getOptions() {
  Options options = new Options();
  options.addOption("b", "bind", true,
      "Address to bind the Thrift server to. [default: 0.0.0.0]");
  options.addOption("p", "port", true, "Port to bind to [default: " + DEFAULT_LISTEN_PORT + "]");
  options.addOption("f", "framed", false, "Use framed transport");
  options.addOption("c", "compact", false, "Use the compact protocol");
  options.addOption("w", "workers", true, "How many worker threads to use.");
  options.addOption("h", "help", false, "Print help information");
  options.addOption(null, "infoport", true, "Port for web UI");
  options.addOption("t", READ_TIMEOUT_OPTION, true,
    "Amount of time in milliseconds before a server thread will timeout " +
    "waiting for client to send data on a connected socket. Currently, " +
    "only applies to TBoundedThreadPoolServer");
  OptionGroup servers = new OptionGroup();
  servers.addOption(
      new Option("nonblocking", false, "Use the TNonblockingServer. This implies the framed transport."));
  servers.addOption(new Option("hsha", false, "Use the THsHaServer. This implies the framed transport."));
  servers.addOption(new Option("threadpool", false, "Use the TThreadPoolServer. This is the default."));
  options.addOptionGroup(servers);
  return options;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:ThriftServer.java

示例2: getCommand

import org.apache.commons.cli.Options; //导入方法依赖的package包/类
@Override
public Command getCommand() {
    return new Command() {
        @Override
        public String getName() {
            return "afs";
        }

        @Override
        public String getTheme() {
            return "Application file system";
        }

        @Override
        public String getDescription() {
            return "application file system command line tool";
        }

        @Override
        public Options getOptions() {
            Options options = new Options();
            OptionGroup optionGroup = new OptionGroup();
            optionGroup.addOption(Option.builder()
                    .longOpt(LS)
                    .desc("list files")
                    .hasArg()
                    .optionalArg(true)
                    .argName("PATH")
                    .build());
            options.addOptionGroup(optionGroup);
            return options;
        }

        @Override
        public String getUsageFooter() {
            return null;
        }
    };
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:40,代码来源:AppFileSystemTool.java

示例3: populate

import org.apache.commons.cli.Options; //导入方法依赖的package包/类
@Override
void populate(Options options) {
    OptionGroup verbosityGroup = new OptionGroup();
    verbosityGroup.setRequired(false);
    verbosityGroup.addOption(new OptionBuilder("s", "silent").required(false).build());
    verbosityGroup.addOption(new OptionBuilder("v", "verbose").required(false).build());
    options.addOptionGroup(verbosityGroup);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:CliToolConfig.java


注:本文中的org.apache.commons.cli.Options.addOptionGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。