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


Java OptionBuilder.isRequired方法代码示例

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


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

示例1: buildOptions

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Build command-line options and descriptions
 *
 * @return command line options
 */
public static Options buildOptions() {
  Options options = new Options();

  // Build in/output file arguments, which are required, but there is no 
  // addOption method that can specify this
  OptionBuilder.isRequired();
  OptionBuilder.hasArgs();
  OptionBuilder.withLongOpt("outputFilename");
  options.addOption(OptionBuilder.create("o"));
  
  OptionBuilder.isRequired();
  OptionBuilder.hasArgs();
  OptionBuilder.withLongOpt("inputFilename");
  options.addOption(OptionBuilder.create("i"));
  
  options.addOption("p", "processor", true, "");
  options.addOption("v", "verbose", false, "");
  options.addOption("f", "fix-txids", false, "");
  options.addOption("r", "recover", false, "");
  options.addOption("h", "help", false, "");

  return options;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:OfflineEditsViewer.java

示例2: buildOptions

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Build command-line options and descriptions
 */
public static Options buildOptions() {
  Options options = new Options();

  // Build in/output file arguments, which are required, but there is no 
  // addOption method that can specify this
  OptionBuilder.isRequired();
  OptionBuilder.hasArgs();
  OptionBuilder.withLongOpt("outputFile");
  options.addOption(OptionBuilder.create("o"));
  
  OptionBuilder.isRequired();
  OptionBuilder.hasArgs();
  OptionBuilder.withLongOpt("inputFile");
  options.addOption(OptionBuilder.create("i"));
  
  options.addOption("p", "processor", true, "");
  options.addOption("h", "help", false, "");
  options.addOption("skipBlocks", false, "");
  options.addOption("printToScreen", false, "");
  options.addOption("delimiter", true, "");

  return options;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:OfflineImageViewer.java

示例3: buildOptions

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Build command-line options and descriptions
 */
private static Options buildOptions() {
  Options options = new Options();

  // Build in/output file arguments, which are required, but there is no
  // addOption method that can specify this
  OptionBuilder.isRequired();
  OptionBuilder.hasArgs();
  OptionBuilder.withLongOpt("inputFile");
  options.addOption(OptionBuilder.create("i"));

  options.addOption("o", "outputFile", true, "");
  options.addOption("p", "processor", true, "");
  options.addOption("h", "help", false, "");
  options.addOption("maxSize", true, "");
  options.addOption("step", true, "");
  options.addOption("addr", true, "");
  options.addOption("delimiter", true, "");
  options.addOption("t", "temp", true, "");

  return options;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:OfflineImageViewerPB.java

示例4: initArgOption

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
private static void initArgOption(boolean required, String optionName, String optionArg) {
	OptionBuilder.withArgName(optionName);
	OptionBuilder.isRequired(required);
	OptionBuilder.hasArg();
	Option opt = OptionBuilder.create(optionArg);
	OPTIONS.addOption(opt);
}
 
开发者ID:boly38,项目名称:mongodbdump-java-wrapper,代码行数:8,代码来源:Main.java

示例5: createCommandLineOptions

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Creates the command line options.
 *
 * @return the {@link Options}
 */
private static Options createCommandLineOptions() {
  Options options = new Options();

  OptionBuilder.withArgName("help");
  OptionBuilder.hasArg(false);
  OptionBuilder.withDescription("print this message");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("help"));

  OptionBuilder.withArgName("file");
  OptionBuilder.hasArg(true);
  OptionBuilder.withDescription("aw-report-alerting-sample.properties file.");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("file"));

  OptionBuilder.withArgName("accountIdsFile");
  OptionBuilder.hasArg(true);
  OptionBuilder.withDescription(
      "Consider ONLY the account IDs specified on the file to run the report");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("accountIdsFile"));

  OptionBuilder.withArgName("debug");
  OptionBuilder.hasArg(false);
  OptionBuilder.withDescription("Will display all the debug information. "
      + "If the option 'verbose' is activated, "
      + "all the information will be displayed on the console as well");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("debug"));

  return options;
}
 
开发者ID:googleads,项目名称:adwords-alerting,代码行数:38,代码来源:AwAlerting.java

示例6: buildOptions

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Method for building the allowed options.
 * @param options Options object for adding the options created with OptionBuilder.
 */
private void buildOptions(Options options){        
    OptionBuilder.withArgName(OPTION_HELP);
    OptionBuilder.withLongOpt(OPTION_HELP);
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Print help message and exit.");
    options.addOption(OptionBuilder.create('h'));
    
    OptionBuilder.withArgName(OPTION_INPUT_JSON);
    OptionBuilder.withLongOpt(OPTION_INPUT_JSON);
    OptionBuilder.isRequired(false);
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Specify the JSON input file.");
    options.addOption(OptionBuilder.create("j"));
}
 
开发者ID:openmainframeproject,项目名称:ade,代码行数:19,代码来源:UpdateGroups.java

示例7: parseArgs

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Method to parse specific arguments for "Upload".
 * 
 * @throws AdeException 
 * 
 */
protected final void parseArgs(String[] args) throws AdeException {
    final Options options = new Options();

    OptionBuilder.withArgName(OPTION_DUMP_PARSE_REPORT);
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Specify this option to generate parse report");
    options.addOption(OptionBuilder.create(OPTION_DUMP_PARSE_REPORT));

    final CommandLine line = super.parseArgs(options, args);

    if (line.hasOption(OPTION_DUMP_PARSE_REPORT)) {
        getAdeExtProperties().setParseReportRequested(true);
    }
}
 
开发者ID:openmainframeproject,项目名称:ade,代码行数:21,代码来源:Upload.java

示例8: parseArgs

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
/**
 * Method to parse specific arguments for "Analyze".
 */
@Override
protected final void parseArgs(String[] args) throws AdeException {
    final Options options = new Options();

    OptionBuilder.withArgName(OPTION_SOURCES);
    OptionBuilder.withLongOpt(OPTION_SOURCES);
    OptionBuilder.isRequired(false);
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Specify the Source to be analyzed.  ");
    options.addOption(OptionBuilder.create("s"));

    super.parseArgs(options, args);

}
 
开发者ID:openmainframeproject,项目名称:ade,代码行数:18,代码来源:Analyze.java

示例9: buildOptions

import org.apache.commons.cli.OptionBuilder; //导入方法依赖的package包/类
public static Options buildOptions(Options subClassOptions) {
    /* Add the options from subClass */
    Options options = new Options();
    for (Object subClassOption : subClassOptions.getOptions()) {
        Option option = (Option) subClassOption;
        options.addOption(option);
    }

    /* Add the general options */
    OptionBuilder.withArgName(OPTION_HELP);
    OptionBuilder.withLongOpt(OPTION_HELP);
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Print help message and exit");
    options.addOption(OptionBuilder.create('h'));

    OptionBuilder.withArgName(OPTION_INPUT_FILE);
    OptionBuilder.withLongOpt(OPTION_INPUT_FILE);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Input file name or 'stdin'");
    options.addOption(OptionBuilder.create('f'));

    OptionBuilder.withArgName(OPTION_INPUT_DIR);
    OptionBuilder.withLongOpt(OPTION_INPUT_DIR);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Input dir name");
    options.addOption(OptionBuilder.create('d'));

    OptionBuilder.withArgName(OPTION_SOURCES);
    OptionBuilder.withLongOpt(OPTION_SOURCES);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Source Names.");
    options.addOption(OptionBuilder.create('s'));

    OptionBuilder.withArgName(OPTION_OS_TYPE);
    OptionBuilder.withLongOpt(OPTION_OS_TYPE);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("The OS Type."
            + "If this option is omitted, the default is Linux");
    options.addOption(OptionBuilder.create('o'));

    OptionBuilder.withArgName(OPTION_GMT_OFFSET);
    OptionBuilder.withLongOpt(OPTION_GMT_OFFSET);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("hours offset from GMT");
    options.addOption(OptionBuilder.create('g'));

    return options;
}
 
开发者ID:openmainframeproject,项目名称:ade,代码行数:54,代码来源:AdeExtOptions.java


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