Example usage for org.apache.commons.cli OptionBuilder withLongOpt

List of usage examples for org.apache.commons.cli OptionBuilder withLongOpt

Introduction

In this page you can find the example usage for org.apache.commons.cli OptionBuilder withLongOpt.

Prototype

public static OptionBuilder withLongOpt(String newLongopt) 

Source Link

Document

The next Option created will have the following long option value.

Usage

From source file:org.dcm4che.tool.dcm2dcm.Dcm2Dcm.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);// w w  w.j a v a  2 s  .com
    CLIUtils.addEncodingOptions(opts);
    OptionGroup tsGroup = new OptionGroup();
    tsGroup.addOption(OptionBuilder.withLongOpt("transfer-syntax").hasArg().withArgName("uid")
            .withDescription(rb.getString("transfer-syntax")).create("t"));
    tsGroup.addOption(OptionBuilder.withLongOpt("jpeg").withDescription(rb.getString("jpeg")).create());
    tsGroup.addOption(OptionBuilder.withLongOpt("jpll").withDescription(rb.getString("jpll")).create());
    tsGroup.addOption(OptionBuilder.withLongOpt("jpls").withDescription(rb.getString("jpls")).create());
    tsGroup.addOption(OptionBuilder.withLongOpt("j2kr").withDescription(rb.getString("j2kr")).create());
    tsGroup.addOption(OptionBuilder.withLongOpt("j2ki").withDescription(rb.getString("j2ki")).create());
    opts.addOptionGroup(tsGroup);
    OptionGroup fmiGroup = new OptionGroup();
    fmiGroup.addOption(OptionBuilder.withLongOpt("no-fmi").withDescription(rb.getString("no-fmi")).create("F"));
    fmiGroup.addOption(
            OptionBuilder.withLongOpt("retain-fmi").withDescription(rb.getString("retain-fmi")).create("f"));
    opts.addOptionGroup(fmiGroup);
    opts.addOption(OptionBuilder.hasArg().withArgName("max-error").withType(PatternOptionBuilder.NUMBER_VALUE)
            .withDescription(rb.getString("verify")).withLongOpt("verify").create());
    opts.addOption(OptionBuilder.hasArg().withArgName("size").withType(PatternOptionBuilder.NUMBER_VALUE)
            .withDescription(rb.getString("verify-block")).withLongOpt("verify-block").create());
    opts.addOption(OptionBuilder.hasArg().withArgName("quality").withType(PatternOptionBuilder.NUMBER_VALUE)
            .withDescription(rb.getString("quality")).create("q"));
    opts.addOption(
            OptionBuilder.hasArg().withArgName("encoding-rate").withType(PatternOptionBuilder.NUMBER_VALUE)
                    .withDescription(rb.getString("encoding-rate")).create("Q"));
    opts.addOption(OptionBuilder.hasArgs().withArgName("name=value").withValueSeparator()
            .withDescription(rb.getString("compression-param")).create("C"));
    CommandLine cl = CLIUtils.parseComandLine(args, opts, rb, Dcm2Dcm.class);
    return cl;
}

From source file:org.dcm4che.tool.dcm2xml.Dcm2Xml.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);/*w w  w  .  j  a  va2 s .c  o m*/
    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, "xml11", false, rb.getString("xml11"));
    addBulkdataOptions(opts);

    return CLIUtils.parseComandLine(args, opts, rb, Dcm2Xml.class);
}

From source file:org.dcm4che.tool.dcm2xml.Dcm2Xml.java

@SuppressWarnings("static-access")
private static void addBulkdataOptions(Options opts) {
    OptionGroup group = new OptionGroup();
    group.addOption(//from  w ww  .  j a  va 2s  . c  o m
            OptionBuilder.withLongOpt("no-bulkdata").withDescription(rb.getString("no-bulkdata")).create("B"));
    group.addOption(OptionBuilder.withLongOpt("with-bulkdata").withDescription(rb.getString("with-bulkdata"))
            .create("b"));
    opts.addOptionGroup(group);
    opts.addOption(OptionBuilder.withLongOpt("blk-file-dir").hasArg().withArgName("directory")
            .withDescription(rb.getString("blk-file-dir")).create("d"));
    opts.addOption(OptionBuilder.withLongOpt("blk-file-prefix").hasArg().withArgName("prefix")
            .withDescription(rb.getString("blk-file-prefix")).create());
    opts.addOption(OptionBuilder.withLongOpt("blk-file-suffix").hasArg().withArgName("suffix")
            .withDescription(rb.getString("blk-file-dir")).create());
    opts.addOption("c", "cat-blk-files", false, rb.getString("cat-blk-files"));
    opts.addOption(OptionBuilder.withLongOpt("blk-spec").hasArg().withArgName("xml-file")
            .withDescription(rb.getString("blk-spec")).create("X"));
}

From source file:org.dcm4che.tool.dcmdir.DcmDir.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);//from   w w  w.  j  ava2 s .  c  om
    CLIUtils.addFilesetInfoOptions(opts);
    OptionGroup cmdGroup = new OptionGroup();
    addCommandOptions(cmdGroup);
    opts.addOptionGroup(cmdGroup);
    opts.addOption(OptionBuilder.withLongOpt("width").hasArg().withArgName("col")
            .withDescription(rb.getString("width")).create("w"));
    opts.addOption(null, "in-use", false, rb.getString("in-use"));
    opts.addOption(null, "orig-seq-len", false, rb.getString("orig-seq-len"));
    CLIUtils.addEncodingOptions(opts);
    CommandLine cl = CLIUtils.parseComandLine(args, opts, rb, DcmDir.class);
    if (cmdGroup.getSelected() == null)
        throw new ParseException(rb.getString("missing"));
    return cl;
}

From source file:org.dcm4che.tool.dcmdump.DcmDump.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);//  w  w w .  j a  v a2 s. c o m
    opts.addOption(OptionBuilder.withLongOpt("width").hasArg().withArgName("col")
            .withDescription(rb.getString("width")).create("w"));
    return CLIUtils.parseComandLine(args, opts, rb, DcmDump.class);
}

From source file:org.dcm4che.tool.dcmvalidate.DcmValidate.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);/*from  www.j  a  v a2 s. c  o  m*/
    opts.addOption(OptionBuilder.withLongOpt("iod").hasArg().withArgName("iod-file")
            .withDescription(rb.getString("iod")).create(null));
    return CLIUtils.parseComandLine(args, opts, rb, DcmValidate.class);
}

From source file:org.dcm4che.tool.emf2sf.Emf2sf.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);//from   w  ww.  ja  va2  s . com
    opts.addOption(OptionBuilder.withLongOpt("frame").hasArgs().withArgName("no[,..]").withValueSeparator(',')
            .withDescription(rb.getString("frame")).create("f"));
    opts.addOption(null, "not-chseries", false, rb.getString("not-chseries"));
    opts.addOption(OptionBuilder.withLongOpt("inst-no").hasArg().withArgName("format")
            .withDescription(rb.getString("inst-no")).create());
    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());
    return CLIUtils.parseComandLine(args, opts, rb, Emf2sf.class);
}

From source file:org.dcm4che.tool.hl72xml.HL72Xml.java

@SuppressWarnings("static-access")
private static CommandLine parseComandLine(String[] args) throws ParseException {
    Options opts = new Options();
    CLIUtils.addCommonOptions(opts);// w  w w  .j  a  va  2  s. c  o  m
    opts.addOption(OptionBuilder.withLongOpt("xsl").hasArg().withArgName("xsl-file")
            .withDescription(rb.getString("xsl")).create("x"));
    opts.addOption(OptionBuilder.withLongOpt("charset").hasArg().withArgName("name")
            .withDescription(rb.getString("charset")).create(null));
    opts.addOption("I", "indent", false, rb.getString("indent"));
    opts.addOption(null, "xmlns", false, rb.getString("xmlns"));

    return CLIUtils.parseComandLine(args, opts, rb, HL72Xml.class);
}

From source file:org.dcm4che.tool.hl7pix.HL7Pix.java

@SuppressWarnings("static-access")
private static void addCharsetOption(Options opts) {
    opts.addOption(OptionBuilder.withLongOpt("charset").hasArg().withArgName("name")
            .withDescription(rb.getString("charset")).create(null));
}

From source file:org.dcm4che.tool.hl7rcv.HL7Rcv.java

@SuppressWarnings("static-access")
public static void addOptions(Options opts) {
    opts.addOption(null, "ignore", false, rb.getString("ignore"));
    opts.addOption(OptionBuilder.hasArg().withArgName("path").withDescription(rb.getString("directory"))
            .withLongOpt("directory").create(null));
    opts.addOption(OptionBuilder.withLongOpt("xsl").hasArg().withArgName("xsl-file")
            .withDescription(rb.getString("xsl")).create("x"));
    opts.addOption(OptionBuilder.withLongOpt("xsl-param").hasArgs().withValueSeparator('=')
            .withArgName("name=value").withDescription(rb.getString("xsl-param")).create(null));
    opts.addOption(OptionBuilder.withLongOpt("charset").hasArg().withArgName("name")
            .withDescription(rb.getString("charset")).create(null));
    opts.addOption(OptionBuilder.hasArg().withArgName("[ip:]port").withDescription(rb.getString("bind-server"))
            .withLongOpt("bind").create("b"));
    opts.addOption(OptionBuilder.hasArg().withArgName("ms").withDescription(rb.getString("idle-timeout"))
            .withLongOpt("idle-timeout").create(null));
}