當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。