List of usage examples for org.apache.commons.cli Option setValueSeparator
public void setValueSeparator(char sep)
From source file:de.iew.imageread.Main.java
protected static Options setupOptions() { Options options = new Options(); Option imageOutputDirOption = new Option("o", "outputDir", true, "The base directory to write the images to (Default: system temp directory)"); imageOutputDirOption.setArgName("outputDir"); Option imageFilenamePrefixOption = new Option("p", "filenamePrefix", true, "The basename/prefix for each image (Default: image-)"); imageFilenamePrefixOption.setArgName("filenamePrefix"); Option groupingOutputOption = new Option("g", "groupingOutput", true, "Grouping option for the images; valid values are ALL, GROUP_BY_DAY (Default: ALL)"); groupingOutputOption.setArgName("groupingOutput"); groupingOutputOption.setType(OUTPUT_OPTION.class); Option queryOption = new Option("q", "query", true, "Query filters for the mongo db queries; valid values for 'query' are FROM, TO and EXACT (Default: no specific query)"); queryOption.setArgs(2);//from www .j a v a 2 s . c o m queryOption.setArgName("query=date"); queryOption.setValueSeparator('='); Option databaseOption = new Option("md", "database", true, "The mongo db database (Default: test)"); databaseOption.setArgName("database"); Option mongodbHostOption = new Option("mh", "hostname", true, "The hostname of the mongo db instance (Default: localhost)"); mongodbHostOption.setArgName("hostname"); Option mongodbPortOption = new Option("mp", "port", true, "The port of the mongo db instance (Default: 27017)"); mongodbPortOption.setArgName("port"); mongodbPortOption.setType(Integer.TYPE); Option printHelpOption = new Option("h", "help", false, "Print help"); options.addOption(imageOutputDirOption); options.addOption(imageFilenamePrefixOption); options.addOption(groupingOutputOption); options.addOption(queryOption); options.addOption(databaseOption); options.addOption(mongodbHostOption); options.addOption(mongodbPortOption); options.addOption(printHelpOption); return options; }
From source file:com.facebook.LinkBench.LinkBenchDriver.java
private static Options initializeOptions() { Options options = new Options(); Option config = new Option("c", true, "Linkbench config file"); config.setArgName("file"); options.addOption(config);//from w w w. j a v a 2s . c o m 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; }
From source file:com.emc.ecs.util.OptionBuilder.java
public Option create(String opt) { // create the option Option option = new Option(opt, description); // set the option properties option.setLongOpt(longOpt);//from w ww . j a va 2s . co m option.setArgs(argNum); option.setValueSeparator(valueSep); option.setArgName(argName); return option; }
From source file:fr.inrialpes.exmo.align.cli.CommonCLI.java
protected Option createListOption(String name, String longName, String desc, String argName, char sep) { Option opt = createOption(name, longName, desc); opt.setArgName(argName);/*from w w w . j ava 2s. co m*/ opt.setValueSeparator(sep); opt.setRequired(true); opt.setArgs(-2); // Nicely undocumented! return opt; }
From source file:fr.inrialpes.exmo.align.cli.CommonCLI.java
public CommonCLI() { parameters = new Properties(); options = new Options(); options.addOption(createOption("h", "help", "Print this page")); options.addOption(createRequiredOption("o", "output", "Send output to FILE", "FILE")); options.addOption(createOptionalOption("d", "debug", "debug argument is deprecated, use logging instead\nSee http://alignapi.gforge.inria.fr/logging.html", "LEVEL")); options.addOption(createRequiredOption("P", "params", "Read parameters from FILE", "FILE")); // Special one Option opt = new Option("D", "Use value for given property"); opt.setArgs(2);/* w w w .ja v a2 s. c o m*/ opt.setValueSeparator('='); opt.setArgName("NAME=VALUE"); options.addOption(opt); }
From source file:com.paxxis.cornerstone.messaging.service.shell.ServiceShell.java
private Options initialize(String[] args) { OptionGroup group = new OptionGroup(); Option helpOpt = new Option(null, "help", false, "this message"); helpOpt.setArgs(2);// w w w.ja v a2s. c o m helpOpt.setValueSeparator(','); group.addOption(helpOpt); Option opt = new Option("sh", "shutdown", true, "the service to shut down"); opt.setArgs(2); opt.setValueSeparator(','); group.addOption(opt); Option updateOpt = new Option(null, "dbupdate", false, "the database update parameters"); updateOpt.setArgs(3); updateOpt.setValueSeparator(','); group.addOption(updateOpt); Option unbindOpt = new Option(null, "unbind", true, "the unbind option to be used ONLY if the service cannot be shut down gracefully"); unbindOpt.setArgs(2); unbindOpt.setValueSeparator(','); group.addOption(unbindOpt); addOptions(group); Options options = new Options(); options.addOptionGroup(group); return options; }
From source file:com.revolsys.gis.tools.ProcessorPipelineTool.java
private void newOptions() { final Option script = new Option(SCRIPT_OPTION, SCRIPT, true, "the script file that defines the processor pipeline"); script.setRequired(true);//from w w w . ja v a 2 s . co m this.options.addOption(script); final Option sourceDirectory = new Option(SOURCE_DIRECTORY_OPTION, SOURCE_DIRECTORY, true, "the location of the source files to process"); sourceDirectory.setRequired(false); this.options.addOption(sourceDirectory); final Option sourceFileExtension = new Option(SOURCE_FILE_EXTENSION_OPTION, SOURCE_FLE_EXTENSION, true, "the file extension of the source files (e.g. .saf)"); sourceFileExtension.setRequired(false); this.options.addOption(sourceFileExtension); final Option outputDirectory = new Option(OUTPUT_DIRECTORY_OPTION, OUTPUT_DIRECTORY, true, "the directory to write processed files to"); outputDirectory.setRequired(false); this.options.addOption(outputDirectory); final Option logDirectory = new Option(LOG_DIRECTORY_OPTION, LOG_DIRECTORY, true, "the directory to write log files to"); logDirectory.setRequired(false); this.options.addOption(logDirectory); final Option excludePattern = new Option(EXCLUDE_PATTERN_OPTION, EXCLUDE_PATTERN, true, "exclude files matching a regular expression (e.g. '.*_back.zip"); excludePattern.setRequired(false); this.options.addOption(excludePattern); final Option property = new Option("D", "property=value", true, "use value for given property"); property.setValueSeparator('='); this.options.addOption(property); }
From source file:de.nrw.hbz.regal.sync.Syncer.java
/** * @param ingester/*from w w w . j a v a2 s .c o m*/ * the ingester is used to pass data to the archive * @param downloader * the downloader is used to download data from a foreign system * @param builder * the builder assembles DigitalEntities from the downloaded data * and passes it to the ingester. */ public Syncer(IngestInterface ingester, DownloaderInterface downloader, DigitalEntityBuilderInterface builder) { this.ingester = ingester; this.downloader = downloader; this.builder = builder; options = new Options(); options.addOption("?", "help", false, "Print usage information"); options.addOption("m", "mode", true, "Specify mode: \n " + "INIT: All PIDs will be downloaded. All pids will be updated or created.\n" + "SYNC: Modified or new PIDs will be downloaded and updated or created\n " + "CONT: All PIDs that aren't already downloaded will be downloaded and created or updated\n" + "UPDT: In accordance to the timestamp all modified PIDs will be reingested" + "PIDL: Use this mode in combination with -list to provide a file with a newline separated pidlist" + "DELE: Use this mode in combination with -list to provide a file with a newline separated pidlist"); options.addOption("u", "user", true, "Specify username"); options.addOption("p", "password", true, "Specify password"); options.addOption("dtl", "dtl", true, "Specify digitool url"); options.addOption("cache", "cache", true, "Specify local directory"); options.addOption("oai", "oai", true, "Specify the OAI-PMH endpoint"); Option setOption = new Option("set", "set", true, "Specify an OAI setSpec"); setOption.setValueSeparator(','); setOption.setRequired(false); setOption.setOptionalArg(true); options.addOption(setOption); options.addOption("timestamp", "timestamp", true, "Specify a local file e.g. .oaitimestamp"); options.addOption("fedoraBase", "fedoraBase", true, "The Fedora Baseurl"); options.addOption("host", "host", true, "The Fedora Baseurl"); options.addOption("namespace", "namespace", true, "The namespace to operate on."); options.addOption("list", "list", true, "Path to a file with a newline separated pidlist. Only needed in combination with mode PIDL and DELE."); options.addOption("keystoreLocation", "keystoreLocation", true, "Specify a keystore for ssl"); options.addOption("keystorePassword", "keystorePassword", true, "Specify a keystore password for ssl"); }
From source file:kieker.tools.logReplayer.FilesystemLogReplayerStarter.java
@Override protected void addAdditionalOptions(final Options options) { Option option; option = new Option("c", CMD_OPT_NAME_MONITORING_CONFIGURATION, true, "Configuration to use for the Kieker monitoring instance"); option.setArgName(OPTION_EXAMPLE_FILE_MONITORING_PROPERTIES); option.setRequired(false);//w ww .j av a 2s.c o m option.setValueSeparator('='); options.addOption(option); option = new Option("i", CMD_OPT_NAME_INPUTDIRS, true, "Log directories to read data from"); option.setArgName("dir1 ... dirN"); option.setRequired(false); option.setArgs(Option.UNLIMITED_VALUES); options.addOption(option); option = new Option("k", CMD_OPT_NAME_KEEPORIGINALLOGGINGTIMESTAMPS, true, "Replay the original logging timestamps (defaults to true)?"); option.setArgName("true|false"); option.setRequired(false); option.setValueSeparator('='); options.addOption(option); option = new Option("r", CMD_OPT_NAME_REALTIME, true, "Replay log data in realtime?"); option.setArgName("true|false"); option.setRequired(false); option.setValueSeparator('='); options.addOption(option); option = new Option("n", CMD_OPT_NAME_NUM_REALTIME_WORKERS, true, "Number of worker threads used in realtime mode (defaults to 1)."); option.setArgName("num"); option.setRequired(false); options.addOption(option); option = new Option("a", CMD_OPT_NAME_REALTIME_ACCELERATION_FACTOR, true, "Factor by which to accelerate (>1.0) or slow down (<1.0) the replay in realtime mode (defaults to 1.0, i.e., no acceleration/slow down)."); option.setArgName("factor"); option.setRequired(false); option.setValueSeparator('='); options.addOption(option); option = new Option(null, CMD_OPT_NAME_IGNORERECORDSBEFOREDATE, true, "Records logged before this date (UTC timezone) are ignored (disabled by default)."); option.setArgName(DATE_FORMAT_PATTERN_CMD_USAGE_HELP); option.setRequired(false); options.addOption(option); option = new Option(null, CMD_OPT_NAME_IGNORERECORDSAFTERDATE, true, "Records logged after this date (UTC timezone) are ignored (disabled by default)."); option.setArgName(DATE_FORMAT_PATTERN_CMD_USAGE_HELP); option.setRequired(false); options.addOption(option); }
From source file:com.github.dakusui.symfonion.CLI.java
private Options buildOptions() { // create Options object Options options = new Options(); //////from w w w .j a va 2 s. c o m // Behavior options options.addOption("V", "version", false, "print the version information."); options.addOption("h", "help", false, "print the command line usage."); options.addOption("l", "list", false, "list the available midi devices."); options.addOption("p", "play", true, "play the specifiled file."); options.addOption("c", "compile", true, "compile the specified file to a standard midi file."); { Option option = OptionBuilder.create("r"); option.setLongOpt("route"); option.setValueSeparator('='); option.setArgs(2); option.setDescription("run a midi patch bay."); options.addOption(option); } //// // I/O options { Option option = OptionBuilder.create("O"); option.setValueSeparator('='); option.setArgs(2); option.setDescription("specify midi out port."); options.addOption(option); } { Option option = OptionBuilder.create("I"); option.setValueSeparator('='); option.setArgs(2); option.setDescription("specify midi in port."); options.addOption(option); } { Option option = OptionBuilder.create("o"); option.setArgs(1); option.setDescription("specify a file to which a compiled standard midi file is output."); options.addOption(option); } return options; }