List of usage examples for org.apache.commons.cli OptionBuilder withValueSeparator
public static OptionBuilder withValueSeparator()
=
' as a means to separate argument values. From source file:org.apache.hive.service.server.HiveServerServerOptionsProcessor.java
@SuppressWarnings("static-access") public HiveServerServerOptionsProcessor(String serverName) { this.serverName = serverName; // -hiveconf x=y options.addOption(OptionBuilder.withValueSeparator().hasArgs(2).withArgName("property=value") .withLongOpt("hiveconf").withDescription("Use value for given property").create()); // -deregister <versionNumber> options.addOption(OptionBuilder.hasArgs(1).withArgName("versionNumber").withLongOpt("deregister") .withDescription("Deregister all instances of given version from dynamic service discovery") .create());// www .j a v a2 s . c o m options.addOption(new Option("H", "help", false, "Print help information")); }
From source file:org.apache.hive.service.server.ServerOptionsProcessor.java
@SuppressWarnings("static-access") public ServerOptionsProcessor(String serverName) { this.serverName = serverName; // -hiveconf x=y options.addOption(OptionBuilder.withValueSeparator().hasArgs(2).withArgName("property=value") .withLongOpt("hiveconf").withDescription("Use value for given property").create()); options.addOption(new Option("H", "help", false, "Print help information")); }
From source file:org.apache.storm.command.OptionsProcessor.java
public OptionsProcessor() { // -t topologyname options.addOption(OptionBuilder.hasArg().withArgName("topologyname").withLongOpt("topologyname") .withDescription("Specify the topologyname to submit").create('t')); // -w waitsecs options.addOption(OptionBuilder.hasArg().withArgName("waitsecs").withLongOpt("waitsecs") .withDescription("waitsecs").create('w')); // -n numworkers options.addOption(OptionBuilder.hasArg().withArgName("numworkers").withLongOpt("numworkers") .withDescription("numworkers").create('n')); // -v key=value -v key=value options.addOption(OptionBuilder.withValueSeparator().hasArgs(2).withArgName("key=value").withLongOpt("var") .withDescription("Variable subsitution to apply to Storm commands. e.g. -v A=B -v C=D") .create('v')); // -c command options.addOption(OptionBuilder.hasArg().withArgName("command").withLongOpt("command") .withDescription("command").create('c')); // -p path// w ww .j a v a 2 s .c om options.addOption( OptionBuilder.hasArg().withArgName("path").withLongOpt("path").withDescription("path").create('p')); }
From source file:org.openscience.jmol.app.JmolApp.java
private Options getOptions() { Options options = new Options(); options.addOption("a", "autoanimationdelay", true, GT._( "delay time in seconds for press-and-hold operation of toolbar animation buttons (default 0.2; numbers > 10 assumed to be milliseconds; set to 0 to disable)")); options.addOption("b", "backgroundtransparent", false, GT._("transparent background")); options.addOption("C", "checkload", false, GT._("check script syntax only - with file loading")); options.addOption("c", "check", false, GT._("check script syntax only - no file loading")); OptionBuilder.withValueSeparator(); options.addOption("D", "property=value", true, GT._("supported options are given below")); options.addOption("d", "debug", false, GT._("debug")); options.addOption("g", "geometry", true, GT.o(GT._("window width x height, e.g. {0}"), "-g500x500")); options.addOption("h", "help", false, GT._("give this help page")); options.addOption("I", "input", false, GT._("allow piping of input from System.Input")); options.addOption("i", "silent", false, GT._("silent startup operation")); options.addOption("J", "jmolscript1", true, GT._("Jmol script to execute BEFORE -s option")); options.addOption("j", "jmolscript2", true, GT._("Jmol script to execute AFTER -s option")); options.addOption("k", "kiosk", false, GT._("kiosk mode -- no frame")); options.addOption("L", "nosplash", false, GT._("start with no splash screen")); options.addOption("l", "list", false, GT._("list commands during script execution")); options.addOption("M", "multitouch", true, GT._("use multitouch interface (requires \"sparshui\" parameter")); options.addOption("m", "menu", true, GT._("menu file to use")); options.addOption("n", "nodisplay", false, GT._("no display (and also exit when done)")); options.addOption("o", "noconsole", false, GT._("no console -- all output to sysout")); options.addOption("P", "port", true, GT._("port for JSON/MolecularPlayground-style communication")); options.addOption("p", "printOnly", false, GT._("send only output from print messages to console (implies -i)")); options.addOption("q", "quality", true, GT._( "JPG image quality (1-100; default 75) or PNG image compression (0-9; default 2, maximum compression 9)")); options.addOption("R", "restricted", false, GT._("restrict local file access")); options.addOption("r", "restrictSpt", false, GT._("restrict local file access (allow reading of SPT files)")); options.addOption("s", "script", true, GT._("script file to execute or '-' for System.in")); options.addOption("T", "headlessmaxtime", true, GT._("headless max time (sec)")); options.addOption("t", "threaded", false, GT._("independent command thread")); options.addOption("w", "write", true, GT.o(GT._("{0} or {1}:filename"), new Object[] { "CLIP", "GIF|JPG|JPG64|PNG|PPM" })); options.addOption("x", "exit", false, GT._("exit after script (implicit with -n)")); return options; }