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


Java OptionGroup.addOption方法代码示例

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


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

示例1: getOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的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: init

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
private void init() {
  options.addOption("v", "verbose", false,
      "Verbose output; emits file and meta data delimiters");
  options.addOption("p", "printkv", false, "Print key/value pairs");
  options.addOption("e", "printkey", false, "Print keys");
  options.addOption("m", "printmeta", false, "Print meta data of file");
  options.addOption("b", "printblocks", false, "Print block index meta data");
  options.addOption("h", "printblockheaders", false, "Print block headers for each block.");
  options.addOption("k", "checkrow", false,
      "Enable row order check; looks for out-of-order keys");
  options.addOption("a", "checkfamily", false, "Enable family check");
  options.addOption("w", "seekToRow", true,
    "Seek to this row and print all the kvs for this row only");
  options.addOption("s", "stats", false, "Print statistics");

  OptionGroup files = new OptionGroup();
  files.addOption(new Option("f", "file", true,
    "File to scan. Pass full-path; e.g. hdfs://a:9000/hbase/hbase:meta/12/34"));
  files.addOption(new Option("r", "region", true,
    "Region to scan. Pass region name; e.g. 'hbase:meta,,1'"));
  options.addOptionGroup(files);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:HFilePrettyPrinter.java

示例3: getCommandLineOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
private static Options getCommandLineOptions() {
    // create the Options
    final Options options = new Options();

    final OptionGroup startup = new OptionGroup();
    final Option port = Option.builder("p")
            .longOpt("port")
            .desc("the port that the server will listen on.")
            .type(Integer.class)
            .numberOfArgs(1)
            .build();
    startup.addOption(port);
    options.addOptionGroup(startup);
    options.addOption("h", "help", false, "print these usage instructions and exit.");
    options.addOption("?", "help", false, "print these usage instructions and exit.");
    options.addOption("v", "version", false, "print product version and exit.");

    return options;
}
 
开发者ID:CloudRacer,项目名称:MockTCPServer,代码行数:20,代码来源:MockTCPServer.java

示例4: createCLIOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
/**
 * Creates the options needed by command line interface
 * 
 * @return the options this CLI can handle
 */
public static Options createCLIOptions() {
    options = new Options();
    typeGroup = new OptionGroup();
    Option msgTypeOpt = new Option("t", "message_type", true, "message type");
    typeGroup.addOption(msgTypeOpt);        
    options.addOptionGroup(typeGroup);
           
    options.addOption("h", "help", false, "show help.");
    options.addOption("r", "response_file", true, "file to store the response in, optional");
    options.addOption("d", "debug", false, "enable debug traces");
    options.addOption("mp", "messaging_protocol", true,
            "name of messaging protocol to be used, e.g. eiffel3, semantics");
    contentGroup = new OptionGroup();
    contentGroup.addOption(new Option("f", "content_file", true, "message content file"));
    contentGroup.addOption(new Option("json", "json_content", true, "json content"));              
    options.addOptionGroup(contentGroup);

    options.addOption("v", "list_versions", false, "lists the versions of generate and all loaded protocols");
    return options;
}
 
开发者ID:Ericsson,项目名称:eiffel-remrem-generate,代码行数:26,代码来源:CLIOptions.java

示例5: getOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
private static Options getOptions() {
  Options options = new Options();
  options.addOption("b", "bind", true,
      "Address to bind the Thrift server to. Not supported by the Nonblocking and HsHa server [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("h", "help", false, "Print help information");
  options.addOption(null, "infoport", true, "Port for web UI");

  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,项目名称:LCIndex-HBase-0.94.16,代码行数:19,代码来源:ThriftServer.java

示例6: createOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
private static Options createOptions()
{

	final Options options = new Options();

	final OptionGroup group = new OptionGroup();
	group.addOption(new Option("h", "help", false, "Print this help message"));
	group.addOption(new Option("i", "input-file", true, "Input file path"));
	group.setRequired(true);

	options.addOptionGroup(group);

	options.addOption("b", "database-file", true, "File to read database from");
	options.addOption("e", "epoch-size", true, "Range for epoch size (default " + Parameters.DEFAULT_EPOCH_SIZE
			+ ")");
	options.addOption("t", "train-threshold", true, "Range for training threshold (default "
			+ Parameters.DEFAULT_TRAIN_THRESHOLD + ")");
	options.addOption("d", "detection-threshold", true, "Range for detection threshold (default "
			+ Parameters.DEFAULT_TEST_THRESHOLD + ")");
	options.addOption("v", "verbose", true, "Verbose level (default 0)");
	options.addOption("o", "output-file", true, "Output file path");

	return options;
}
 
开发者ID:amrabed,项目名称:rhids,代码行数:25,代码来源:RHIDS.java

示例7: buildPa11yOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
public static Options buildPa11yOptions() {
    Options options = new Options();

    OptionGroup mutuallyExclusiveOptions = new OptionGroup();
    mutuallyExclusiveOptions.addOption(getCreateTaskOption());
    mutuallyExclusiveOptions.addOption(getListTasksOption());
    mutuallyExclusiveOptions.addOption(getRunOption());
    mutuallyExclusiveOptions.addOption(getRetrieveTaskOption());
    mutuallyExclusiveOptions.addOption(getDeleteTaskOption());

    options.addOptionGroup(mutuallyExclusiveOptions);
    options.addOption(getNameOption());
    options.addOption(getUrlOption());
    options.addOption(getStandardOption());
    options.addOption(getLastResultOption());
    options.addOption(getTaskIdOption());

    return options;
}
 
开发者ID:timtroup,项目名称:pa11y-java-client,代码行数:20,代码来源:OptionsBuilder.java

示例8: CubeMetaExtractor

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
public CubeMetaExtractor() {
    super();
    OptionGroup realizationOrProject = new OptionGroup();
    realizationOrProject.addOption(OPTION_CUBE);
    realizationOrProject.addOption(OPTION_PROJECT);
    realizationOrProject.addOption(OPTION_HYBRID);
    realizationOrProject.addOption(OPTION_All_PROJECT);
    realizationOrProject.setRequired(true);

    options.addOptionGroup(realizationOrProject);
    options.addOption(OPTION_INCLUDE_SEGMENTS);
    options.addOption(OPTION_INCLUDE_JOB);
    options.addOption(OPTION_INCLUDE_SEGMENT_DETAILS);
    options.addOption(OPTION_INCLUDE_ONLY_JOB_OUTPUT);
    options.addOption(OPTION_STORAGE_TYPE);
    options.addOption(OPTION_ENGINE_TYPE);

}
 
开发者ID:apache,项目名称:kylin,代码行数:19,代码来源:CubeMetaExtractor.java

示例9: getOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的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("h", "help", false, "Print help information");
  options.addOption(null, "infoport", true, "Port for web UI");

  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:tenggyut,项目名称:HIndex,代码行数:19,代码来源:ThriftServer.java

示例10: parseDefaultCommandLineArguments

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
/**
 * Populates the default command line arguments that are common to all analyses.
 * 
 * @param options The command line options object that should be modified.
 */
private void parseDefaultCommandLineArguments(Options options) {
  OptionGroup modelGroup = new OptionGroup();
  modelGroup.addOption(Option.builder("model").desc("Path to the model directory.").hasArg()
      .argName("model directory").build());
  modelGroup.addOption(Option.builder("cmodel").desc("Path to the compiled model.").hasArg()
      .argName("compiled model").build());
  modelGroup.setRequired(false);

  options.addOptionGroup(modelGroup);

  options.addOption(Option.builder("cp").desc("The classpath for the analysis.").hasArg()
      .argName("classpath").required().longOpt("classpath").build());
  options.addOption(Option.builder("in").desc("The input code for the analysis.").hasArg()
      .argName("input").required().longOpt("input").build());
  options.addOption(Option.builder("out").desc("The output directory or file.").hasArg()
      .argName("output").longOpt("output").build());
  options.addOption(Option.builder("traversemodeled").desc("Propagate through modeled classes.")
      .hasArg(false).build());
  options.addOption("modeledtypesonly", false, "Only infer modeled types.");
  options.addOption(Option.builder("threadcount")
      .desc("The maximum number of threads that should be used.").hasArg()
      .argName("thread count").type(Number.class).build());
}
 
开发者ID:serval-snt-uni-lu,项目名称:DroidRA,代码行数:29,代码来源:CommandLineParser.java

示例11: init

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
private void init() {
  options.addOption("v", "verbose", false,
      "Verbose output; emits file and meta data delimiters");
  options.addOption("p", "printkv", false, "Print key/value pairs");
  options.addOption("e", "printkey", false, "Print keys");
  options.addOption("m", "printmeta", false, "Print meta data of file");
  options.addOption("b", "printblocks", false, "Print block index meta data");
  options.addOption("h", "printblockheaders", false, "Print block headers for each block.");
  options.addOption("k", "checkrow", false,
      "Enable row order check; looks for out-of-order keys");
  options.addOption("a", "checkfamily", false, "Enable family check");
  options.addOption("w", "seekToRow", true,
    "Seek to this row and print all the kvs for this row only");
  options.addOption("s", "stats", false, "Print statistics");
  options.addOption("i", "checkMobIntegrity", false,
    "Print all cells whose mob files are missing");

  OptionGroup files = new OptionGroup();
  files.addOption(new Option("f", "file", true,
    "File to scan. Pass full-path; e.g. hdfs://a:9000/hbase/hbase:meta/12/34"));
  files.addOption(new Option("r", "region", true,
    "Region to scan. Pass region name; e.g. 'hbase:meta,,1'"));
  options.addOptionGroup(files);
}
 
开发者ID:apache,项目名称:hbase,代码行数:25,代码来源:HFilePrettyPrinter.java

示例12: getOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
public static Options getOptions() {
	Options opts = new Options();
	opts.addOption(O_Q);

	OptionGroup og = new OptionGroup();
	og.addOption(O_START);
	og.addOption(O_RESUME);
	opts.addOptionGroup(og);
	
	opts.addOption(O_END);
	opts.addOption(O_DAYS);
	
	opts.addOption(O_MAXBIB);
	opts.addOption(O_MAXTIME);
	opts.addOption(O_CONFIG);
	return opts;
}
 
开发者ID:Georgetown-University-Libraries,项目名称:GUExtractSierraBibs,代码行数:18,代码来源:CommandLineOptions.java

示例13: createAdminOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的package包/类
private Options createAdminOptions() {
	Options adminOptions = new Options();
	Option url = new Option(URL_OPTION, true, "Ivory URL");
	adminOptions.addOption(url);

	OptionGroup group = new OptionGroup();
	// Option status = new Option(STATUS_OPTION, false,
	// "show the current system status");
	Option version = new Option(VERSION_OPTION, false,
			"show Ivory server build version");
	Option help = new Option("help", false, "show Ivory help");
	group.addOption(version);
	group.addOption(help);

	adminOptions.addOptionGroup(group);
	return adminOptions;
}
 
开发者ID:sriksun,项目名称:ivry-security,代码行数:18,代码来源:IvoryCLI.java

示例14: getOptions

import org.apache.commons.cli.OptionGroup; //导入方法依赖的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("h", "help", false, "Print help information");

  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:daidong,项目名称:DominoHBase,代码行数:18,代码来源:ThriftServer.java

示例15: getCommand

import org.apache.commons.cli.OptionGroup; //导入方法依赖的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


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