List of usage examples for org.apache.commons.cli OptionBuilder withLongOpt
public static OptionBuilder withLongOpt(String newLongopt)
From source file:org.commonjava.emb.boot.main.EMBCLIManager.java
@SuppressWarnings("static-access") private void populateNativeMavenOptions(final Options options) { options.addOption(OptionBuilder.withLongOpt("file").hasArg() .withDescription("Force the use of an alternate POM file.").create(CLIManager.ALTERNATE_POM_FILE)); options.addOption(OptionBuilder.withLongOpt("define").hasArg().withDescription("Define a system property") .create(CLIManager.SET_SYSTEM_PROPERTY)); options.addOption(//from www .j a va 2 s . co m OptionBuilder.withLongOpt("offline").withDescription("Work offline").create(CLIManager.OFFLINE)); options.addOption(OptionBuilder.withLongOpt("help").withDescription("Display help information") .create(CLIManager.HELP)); options.addOption(OptionBuilder.withLongOpt("version").withDescription("Display version information") .create(CLIManager.VERSION)); options.addOption(OptionBuilder.withLongOpt("quiet").withDescription("Quiet output - only show errors") .create(CLIManager.QUIET)); options.addOption(OptionBuilder.withLongOpt("debug").withDescription("Produce execution debug output") .create(CLIManager.DEBUG)); options.addOption(OptionBuilder.withLongOpt("errors").withDescription("Produce execution error messages") .create(CLIManager.ERRORS)); options.addOption(OptionBuilder.withLongOpt("non-recursive") .withDescription("Do not recurse into sub-projects").create(CLIManager.NON_RECURSIVE)); options.addOption(OptionBuilder.withLongOpt("update-snapshots") .withDescription("Forces a check for updated releases and snapshots on remote repositories") .create(CLIManager.UPDATE_SNAPSHOTS)); options.addOption(OptionBuilder.withLongOpt("activate-profiles") .withDescription("Comma-delimited list of profiles to activate").hasArg() .create(CLIManager.ACTIVATE_PROFILES)); options.addOption(OptionBuilder.withLongOpt("batch-mode") .withDescription("Run in non-interactive (batch) mode").create(CLIManager.BATCH_MODE)); options.addOption(OptionBuilder.withLongOpt("no-snapshot-updates") .withDescription("Supress SNAPSHOT updates").create(CLIManager.SUPRESS_SNAPSHOT_UPDATES)); options.addOption(OptionBuilder.withLongOpt("strict-checksums") .withDescription("Fail the build if checksums don't match") .create(CLIManager.CHECKSUM_FAILURE_POLICY)); options.addOption(OptionBuilder.withLongOpt("lax-checksums") .withDescription("Warn if checksums don't match").create(CLIManager.CHECKSUM_WARNING_POLICY)); options.addOption( OptionBuilder.withLongOpt("settings").withDescription("Alternate path for the user settings file") .hasArg().create(CLIManager.ALTERNATE_USER_SETTINGS)); options.addOption(OptionBuilder.withLongOpt("global-settings") .withDescription("Alternate path for the global settings file").hasArg() .create(CLIManager.ALTERNATE_GLOBAL_SETTINGS)); options.addOption(OptionBuilder.withLongOpt("toolchains") .withDescription("Alternate path for the user toolchains file").hasArg() .create(CLIManager.ALTERNATE_USER_TOOLCHAINS)); options.addOption(OptionBuilder.withLongOpt("fail-fast") .withDescription("Stop at first failure in reactorized builds").create(CLIManager.FAIL_FAST)); options.addOption(OptionBuilder.withLongOpt("fail-at-end") .withDescription("Only fail the build afterwards; allow all non-impacted builds to continue") .create(CLIManager.FAIL_AT_END)); options.addOption(OptionBuilder.withLongOpt("fail-never") .withDescription("NEVER fail the build, regardless of project result") .create(CLIManager.FAIL_NEVER)); options.addOption(OptionBuilder.withLongOpt("resume-from").hasArg() .withDescription("Resume reactor from specified project").create(CLIManager.RESUME_FROM)); options.addOption(OptionBuilder.withLongOpt("projects").withDescription( "Build specified reactor projects instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.") .hasArg().create(CLIManager.PROJECT_LIST)); options.addOption(OptionBuilder.withLongOpt("also-make") .withDescription("If project list is specified, also build projects required by the list") .create(CLIManager.ALSO_MAKE)); options.addOption(OptionBuilder.withLongOpt("also-make-dependents") .withDescription( "If project list is specified, also build projects that depend on projects on the list") .create(CLIManager.ALSO_MAKE_DEPENDENTS)); options.addOption(OptionBuilder.withLongOpt("log-file").hasArg() .withDescription("Log file to where all build output will go.").create(CLIManager.LOG_FILE)); options.addOption(OptionBuilder.withLongOpt("show-version") .withDescription("Display version information WITHOUT stopping build") .create(CLIManager.SHOW_VERSION)); options.addOption(OptionBuilder.withLongOpt("encrypt-master-password").hasArg() .withDescription("Encrypt master security password").create(CLIManager.ENCRYPT_MASTER_PASSWORD)); options.addOption(OptionBuilder.withLongOpt("encrypt-password").hasArg() .withDescription("Encrypt server password").create(CLIManager.ENCRYPT_PASSWORD)); options.addOption(OptionBuilder.withLongOpt("threads").hasArg() .withDescription("Thread count, for instance 2.0C where C is core multiplied") .create(CLIManager.THREADS)); // Adding this back in for compatibility with the verifier that hard codes this option. options.addOption(OptionBuilder.withLongOpt("no-plugin-registry") .withDescription("Ineffective, only kept for backward compatibility").create("npr")); }
From source file:org.cosysoft.dcm.tool.FindSCUTool.java
@SuppressWarnings("static-access") private static void addCancelOption(Options opts) { opts.addOption(OptionBuilder.withLongOpt("cancel").hasArg().withArgName("num-matches") .withDescription(rb.getString("cancel")).create()); }
From source file:org.cosysoft.dcm.tool.FindSCUTool.java
@SuppressWarnings("static-access") private static void addOutputOptions(Options opts) { opts.addOption(OptionBuilder.withLongOpt("out-dir").hasArg().withArgName("directory") .withDescription(rb.getString("out-dir")).create()); opts.addOption(OptionBuilder.withLongOpt("out-file").hasArg().withArgName("name") .withDescription(rb.getString("out-file")).create()); opts.addOption("X", "xml", false, rb.getString("xml")); opts.addOption(OptionBuilder.withLongOpt("xsl").hasArg().withArgName("xsl-file") .withDescription(rb.getString("xsl")).create("x")); opts.addOption("I", "indent", false, rb.getString("indent")); opts.addOption("K", "no-keyword", false, rb.getString("no-keyword")); opts.addOption(null, "xmlns", false, rb.getString("xmlns")); opts.addOption(null, "out-cat", false, rb.getString("out-cat")); }
From source file:org.cosysoft.dcm.tool.MoveSCUTool.java
@SuppressWarnings("static-access") private static void addDestinationOption(Options opts) { opts.addOption(OptionBuilder.withLongOpt("dest").hasArg().withArgName("aet") .withDescription(rb.getString("dest")).create()); }
From source file:org.cytoscape.cmdline.gui.internal.Parser.java
private Options initOptions() { Options opt = new Options(); opt.addOption("h", "help", false, "Print this message."); opt.addOption("v", "version", false, "Print the version number."); opt.addOption(OptionBuilder.withLongOpt("session").withDescription("Load a cytoscape session (.cys) file.") .withValueSeparator('\0').withArgName("file").hasArg() // only allow one session!!! .create("s")); opt.addOption(OptionBuilder.withLongOpt("network").withDescription("Load a network file (any format).") .withValueSeparator('\0').withArgName("file").hasArgs().create("N")); opt.addOption(OptionBuilder.withLongOpt("props").withDescription( "Load cytoscape properties file (Java properties format) or individual property: -P name=value.") .withValueSeparator('\0').withArgName("file").hasArgs().create("P")); opt.addOption(OptionBuilder.withLongOpt("vizmap") .withDescription("Load vizmap properties file (Cytoscape VizMap format).").withValueSeparator('\0') .withArgName("file").hasArgs().create("V")); opt.addOption(OptionBuilder.withLongOpt("script").withDescription("Execute commands from script file") .withValueSeparator('\0').withArgName("file").hasArgs().create("S")); opt.addOption(OptionBuilder.withLongOpt("rest").withDescription("Start a rest service") .withValueSeparator('\0').withArgName("port").hasArgs().create("R")); return opt;/*from w w w . j a v a 2 s . c om*/ }
From source file:org.cytoscape.cmdline.headless.internal.Parser.java
private Options initOptions() { Options opt = new Options(); opt.addOption("h", "help", false, "Print this message."); opt.addOption("v", "version", false, "Print the version number."); opt.addOption(OptionBuilder.withLongOpt("command").withDescription("Cytoscape command file to be executed.") .withValueSeparator('\0').withArgName("file").hasArgs().create("c")); return opt;/* w w w. j a va2s .c o m*/ }
From source file:org.dcm4che.tool.common.CLIUtils.java
@SuppressWarnings("static-access") public static void addPriorityOption(Options opts) { OptionGroup group = new OptionGroup(); group.addOption(// w ww .j a v a 2 s. co m OptionBuilder.withLongOpt("prior-high").withDescription(rb.getString("prior-high")).create()); group.addOption(OptionBuilder.withLongOpt("prior-low").withDescription(rb.getString("prior-low")).create()); opts.addOptionGroup(group); }
From source file:org.dcm4che.tool.common.CLIUtils.java
@SuppressWarnings("static-access") public static void addEncodingOptions(Options opts) { opts.addOption(null, "group-len", false, rb.getString("group-len")); OptionGroup sqlenGroup = new OptionGroup(); sqlenGroup.addOption(OptionBuilder.withLongOpt("expl-seq-len").withDescription(rb.getString("expl-seq-len")) .create(null));//from w w w. ja va 2 s.co m sqlenGroup.addOption(OptionBuilder.withLongOpt("undef-seq-len") .withDescription(rb.getString("undef-seq-len")).create(null)); opts.addOptionGroup(sqlenGroup); OptionGroup itemlenGroup = new OptionGroup(); itemlenGroup.addOption(OptionBuilder.withLongOpt("expl-item-len") .withDescription(rb.getString("expl-item-len")).create(null)); itemlenGroup.addOption(OptionBuilder.withLongOpt("undef-item-len") .withDescription(rb.getString("undef-item-len")).create(null)); opts.addOptionGroup(itemlenGroup); }
From source file:org.dcm4che.tool.common.CLIUtils.java
@SuppressWarnings("static-access") public static void addFilesetInfoOptions(Options opts) { opts.addOption(OptionBuilder.withLongOpt("fs-desc").hasArg().withArgName("txtfile") .withDescription(rb.getString("fs-desc")).create()); opts.addOption(OptionBuilder.withLongOpt("fs-desc-cs").hasArg().withArgName("code") .withDescription(rb.getString("fs-desc-cs")).create()); opts.addOption(OptionBuilder.withLongOpt("fs-id").hasArg().withArgName("id") .withDescription(rb.getString("fs-id")).create()); opts.addOption(OptionBuilder.withLongOpt("fs-uid").hasArg().withArgName("uid") .withDescription(rb.getString("fs-uid")).create()); }
From source file:org.dcm4che.tool.common.CLIUtils.java
@SuppressWarnings("static-access") public static void addTransferSyntaxOptions(Options opts) { OptionGroup group = new OptionGroup(); group.addOption(//from www . j a va 2 s . c o m OptionBuilder.withLongOpt("explicit-vr").withDescription(rb.getString("explicit-vr")).create()); group.addOption( OptionBuilder.withLongOpt("big-endian").withDescription(rb.getString("big-endian")).create()); group.addOption( OptionBuilder.withLongOpt("implicit-vr").withDescription(rb.getString("implicit-vr")).create()); opts.addOptionGroup(group); }