option.setArgs(numberOfArgs); option.setType(type); option.setValueSeparator(valuesep); option.setArgName(argName);
cfg.setValueSeparator('='); cfg.setType(String.class); minTtl.setValueSeparator('='); minTtl.setType(Long.class); maxTtl.setValueSeparator('='); maxTtl.setType(Long.class); duration.setValueSeparator('='); duration.setType(Long.class); log.setValueSeparator('='); log.setType(String.class);
/** * Creates cli options. * * @return Command line options */ private static Options createOptions() { Options options = new Options(); OptionGroup grp = new OptionGroup(); grp.setRequired(true); Option cfg = new Option(OPTION_CFG, null, true, "path to Spring XML configuration file."); cfg.setArgName("file"); Option n = new Option(null, OPTION_N, true, "nodes count."); n.setValueSeparator('='); n.setType(Integer.class); grp.addOption(cfg); grp.addOption(n); options.addOptionGroup(grp); return options; } }
private Options createOptions() { Options options = new Options(); Option systemPropertyOption = new Option("D", "specify system property to override configuration from database.properties"); systemPropertyOption.setArgName("property=value"); systemPropertyOption.setValueSeparator('='); systemPropertyOption.setArgs(2); options.addOption(systemPropertyOption); options.addOption("f", "force", false, "Force push even if critical folders will be deleted"); return options; }
private Options createOptions() { Options options = new Options(); Option systemPropertyOption = new Option("D", "specify system property to override configuration from database.properties"); systemPropertyOption.setArgName("property=value"); systemPropertyOption.setValueSeparator('='); systemPropertyOption.setArgs(2); options.addOption(systemPropertyOption); options.addOption("f", "force", false, "Force push even if critical folders will be deleted"); return options; }
public RegenerateInterleavedStorageIndexFile() { super(CMD_REGENERATE_INTERLEAVED_STORAGE_INDEX_FILE); Option ledgerOption = new Option("l", "ledgerIds", true, "Ledger(s) whose index needs to be regenerated." + " Multiple can be specified, comma separated."); ledgerOption.setRequired(true); ledgerOption.setValueSeparator(','); ledgerOption.setArgs(Option.UNLIMITED_VALUES); opts.addOption(ledgerOption); opts.addOption("dryRun", false, "Process the entryLogger, but don't write anything."); opts.addOption("password", true, "The bookie stores the password in the index file, so we need it to regenerate. " + "This must match the value in the ledger metadata."); opts.addOption("b64password", true, "The password in base64 encoding, for cases where the password is not UTF-8."); }
private static Options createOptions() { Options options = new Options(); options.addOption(ARG_PORT, true, "port (default=8080)"); options.addOption(WebappCommon.ARG_BUILD, false, ""); options.addOption(WebappCommon.ARG_GTFS_PATH, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_TRIP_UPDATES_URL, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_VEHICLE_POSITIONS_URL, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_ALERTS_URL, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_REFRESH_INTERVAL, true, ""); Option pOption = new Option("P", "use value for given property"); pOption.setArgName("beanName.beanProperty=value"); pOption.setArgs(2); pOption.setValueSeparator('='); options.addOption(pOption); return options; }
private static Options createOptions() { Options options = new Options(); options.addOption(ARG_PORT, true, "port (default=8080)"); options.addOption(WebappCommon.ARG_BUILD, false, ""); options.addOption(WebappCommon.ARG_GTFS_PATH, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_TRIP_UPDATES_URL, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_VEHICLE_POSITIONS_URL, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_ALERTS_URL, true, ""); options.addOption(WebappCommon.ARG_GTFS_REALTIME_REFRESH_INTERVAL, true, ""); Option pOption = new Option("P", "use value for given property"); pOption.setArgName("beanName.beanProperty=value"); pOption.setArgs(2); pOption.setValueSeparator('='); options.addOption(pOption); return options; }
protected void buildOptions(Options options) { options.addOption(ARG_USE_DATABASE_FOR_GTFS, false, ""); options.addOption(ARG_SKIP_TO, true, ""); options.addOption(ARG_ONLY, true, ""); options.addOption(ARG_SKIP, true, ""); options.addOption(ARG_INCLUDE, true, ""); options.addOption(ARG_ONLY_IF_DNE, false, ""); options.addOption(ARG_DATASOURCE_DRIVER_CLASS_NAME, true, ""); options.addOption(ARG_DATASOURCE_URL, true, ""); options.addOption(ARG_DATASOURCE_USERNAME, true, ""); options.addOption(ARG_DATASOURCE_PASSWORD, true, ""); options.addOption(ARG_BUNDLE_KEY, true, ""); options.addOption(ARG_RANDOMIZE_CACHE_DIR, false, ""); options.addOption(ARG_ADDITIONAL_RESOURCES_DIRECTORY, true, ""); options.addOption(ARG_OSM, true, ""); Option dOption = new Option("D", "use value for given property"); dOption.setArgName("property=value"); dOption.setArgs(2); dOption.setValueSeparator('='); options.addOption(dOption); Option pOption = new Option("P", "use value for given property"); pOption.setArgName("beanName.beanProperty=value"); pOption.setArgs(2); pOption.setValueSeparator('='); options.addOption(pOption); }
protected void buildOptions(Options options) { options.addOption(ARG_USE_DATABASE_FOR_GTFS, false, ""); options.addOption(ARG_SKIP_TO, true, ""); options.addOption(ARG_ONLY, true, ""); options.addOption(ARG_SKIP, true, ""); options.addOption(ARG_INCLUDE, true, ""); options.addOption(ARG_ONLY_IF_DNE, false, ""); options.addOption(ARG_DATASOURCE_DRIVER_CLASS_NAME, true, ""); options.addOption(ARG_DATASOURCE_URL, true, ""); options.addOption(ARG_DATASOURCE_USERNAME, true, ""); options.addOption(ARG_DATASOURCE_PASSWORD, true, ""); options.addOption(ARG_BUNDLE_KEY, true, ""); options.addOption(ARG_RANDOMIZE_CACHE_DIR, false, ""); options.addOption(ARG_ADDITIONAL_RESOURCES_DIRECTORY, true, ""); Option dOption = new Option("D", "use value for given property"); dOption.setArgName("property=value"); dOption.setArgs(2); dOption.setValueSeparator('='); options.addOption(dOption); Option pOption = new Option("P", "use value for given property"); pOption.setArgName("beanName.beanProperty=value"); pOption.setArgs(2); pOption.setValueSeparator('='); options.addOption(pOption); }
private void addNewOption(String optionName, String argName, String details, Class type, boolean required, Character valueSeparator, boolean isUnlimited) { final Option option = new Option(optionName, true, details); option.setRequired(required); option.setArgName(argName); if (type != null) { option.setType(type); } if (valueSeparator != null) { option.setValueSeparator(valueSeparator); } if (isUnlimited) { option.setArgs(Option.UNLIMITED_VALUES); } options.addOption(option); }
private static Options initializeOptions() { Options options = new Options(); Option config = new Option("c", true, "Linkbench config file"); config.setArgName("file"); options.addOption(config); Option log = new Option("L", true, "Log to this file"); log.setArgName("file"); options.addOption(log); Option csvStats = new Option("csvstats", "csvstats", true, "CSV stats output"); csvStats.setArgName("file"); options.addOption(csvStats); Option csvStream = new Option("csvstream", "csvstream", true, "CSV streaming stats output"); csvStream.setArgName("file"); options.addOption(csvStream); options.addOption("l", false, "Execute loading stage of benchmark"); options.addOption("r", false, "Execute request stage of benchmark"); // Java-style properties to override config file // -Dkey=value Option property = new Option("D", "Override a config setting"); property.setArgs(2); property.setArgName("property=value"); property.setValueSeparator('='); options.addOption(property); return options; }
public Option op() { Option option = new Option( id!=null ? id : " ", description ); option.setLongOpt(name); option.setRequired( required ); option.setOptionalArg(optional); option.setType( type ); option.setValueSeparator(sperator); if( arg !=null && args==-1 ) { args=1; } option.setArgs(args); option.setArgName(arg); return option; }
public Option op() { Option option = new Option( id!=null ? id : " ", description ); option.setLongOpt(name); option.setRequired( required ); option.setOptionalArg(optional); option.setType( type ); option.setValueSeparator(sperator); if( arg !=null && args==-1 ) { args=1; } option.setArgs(args); option.setArgName(arg); return option; }
public Option op() { Option option = new Option( id!=null ? id : " ", description ); option.setLongOpt(name); option.setRequired( required ); option.setOptionalArg(optional); option.setType( type ); option.setValueSeparator(sperator); if( arg !=null && args==-1 ) { args=1; } option.setArgs(args); option.setArgName(arg); return option; }
/** * Creates an Option using OptionBuilder's State and the given parameters. * * @param opt * short representation of the option * @param longOpt * long representation of the option * @param desc * descibes the function of the option * @return the new Option */ public Option create(final String opt, final String longOpt, final String desc) { final Option option = new Option(opt, desc); option.setLongOpt(longOpt); option.setArgs(args); option.setRequired(required); option.setOptionalArg(optionalArg); option.setType(type); option.setValueSeparator(valSeparator); return option; }
/** * Create an Option using the current settings and with * the specified Option <code>char</code>. * * @param opt the <code>java.lang.String</code> representation * of the Option * * @return the Option instance * * @throws IllegalArgumentException if <code>opt</code> is not * a valid character. See Option. */ public Option create(String opt) throws IllegalArgumentException { Option option = new Option(opt, description); // set the option properties option.setLongOpt(longopt); option.setRequired(required); option.setOptionalArg(optionalArg); option.setArgs(numberOfArgs); option.setType(type); option.setValueSeparator(valuesep); option.setArgName(argName); // return the Option instance return option; } }
/** * Create an Option using the current settings and with * the specified Option <code>char</code>. * * @param opt the <code>java.lang.String</code> representation * of the Option * @return the Option instance * @throws IllegalArgumentException if <code>opt</code> is not * a valid character. See Option. */ public static Option create(String opt) throws IllegalArgumentException { // create the option Option option = new Option(opt, description); // set the option properties option.setLongOpt(longopt); option.setRequired(required); option.setOptionalArg(optionalArg); option.setArgs(numberOfArgs); option.setType(type); option.setValueSeparator(valuesep); option.setArgName(argName); // reset the OptionBuilder properties OptionBuilder.reset(); // return the Option instance return option; } }
/** * Create an Option using the current settings and with * the specified Option <code>char</code>. * * @param opt the <code>java.lang.String</code> representation * of the Option * @return the Option instance * @throws IllegalArgumentException if <code>opt</code> is not * a valid character. See Option. */ public static Option create(String opt) throws IllegalArgumentException { // create the option Option option = new Option(opt, description); // set the option properties option.setLongOpt(longopt); option.setRequired(required); option.setOptionalArg(optionalArg); option.setArgs(numberOfArgs); option.setType(type); option.setValueSeparator(valuesep); option.setArgName(argName); // reset the OptionBuilder properties OptionBuilder.reset(); // return the Option instance return option; } }
CliModel(Set<Field> fields) { for (Field field : fields) { CliOption optionAnnotation = field.getAnnotation(CliOption.class); CliArgs argsAnnotation = field.getAnnotation(CliArgs.class); if (optionAnnotation != null) { Option option = new Option( optionAnnotation.name(), optionAnnotation.longName(), optionAnnotation.valueCount() > 0 || optionAnnotation.valueCount() == -1, optionAnnotation.description() ); if (optionAnnotation.valueCount() == -1) { option.setArgs(Option.UNLIMITED_VALUES); } else if (optionAnnotation.valueCount() > 0) { option.setArgs(optionAnnotation.valueCount()); } option.setValueSeparator(optionAnnotation.valueSeparator()); option.setRequired(optionAnnotation.mandatory()); option.setOptionalArg(!optionAnnotation.mandatoryValue()); optionAnnotations.add(optionAnnotation); optionFields.add(field); options.addOption(option); } else if (argsAnnotation != null) { mandatoryArgsCount = argsAnnotation.mandatoryCount(); argsField = field; } } }