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

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

Introduction

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

Prototype

public static Option create(String opt) throws IllegalArgumentException 

Source Link

Document

Create an Option using the current settings and with the specified Option char.

Usage

From source file:ubc.pavlab.aspiredb.cli.ProjectManagerCLI.java

@Override
protected void buildOptions() {

    OptionBuilder.hasArg();//  ww  w .j a  v a 2 s  . co  m
    OptionBuilder.withArgName("group name");
    OptionBuilder.withDescription("The group to give permissions to");
    Option groupname = OptionBuilder.create("groupname");

    OptionBuilder.isRequired();
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("Project name");
    OptionBuilder.withDescription("The project that will be affected by these operations");
    Option project = OptionBuilder.create("project");

    OptionBuilder.hasArg();
    OptionBuilder.withArgName("Overlap Project name");
    OptionBuilder
            .withDescription("The project that the other project will have its overlaps calculated against");
    Option projectOverlap = OptionBuilder.create("overlapProject");

    addOption("delete", false, "Using this option will delete the project");
    addOption("grant", false, "Using this option will grant the group read permissions on the project");
    addOption("restrict", false, "Using this option will remove the group's read permissions on the project");

    addOption("populateOverlap", false,
            "Using this option will populate the overlap between project and overlapProject");

    addOption(groupname);
    addOption(project);

    addOption(projectOverlap);
}

From source file:ubc.pavlab.aspiredb.cli.VariantUploadCLI.java

@Override
protected void buildOptions() {
    OptionBuilder.isRequired();//from w w w  . j a v a  2  s  .  c  o m
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("Directory");
    OptionBuilder.withDescription("Directory containing csv files");
    OptionBuilder.withLongOpt("directory");
    Option d = OptionBuilder.create('d');

    OptionBuilder.isRequired();
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("File name");
    OptionBuilder.withDescription("The file to parse");
    OptionBuilder.withLongOpt("filename");
    Option f = OptionBuilder.create('f');

    OptionBuilder.isRequired();
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("Variant Type");
    OptionBuilder.withDescription("The type of variant in this file, one of: CNV, Indel, SNV, Inversion");
    Option variantType = OptionBuilder.create("variant");

    OptionBuilder.isRequired();
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("Project name");
    OptionBuilder.withDescription(
            "The project where this data will reside. Project will be created if does not exist,"
                    + "If the project does exist use the existingproject option to add to an existing project");
    Option project = OptionBuilder.create("project");

    addOption("existingproject", false, "You must use this option if you are adding to an existing project");

    addOption("dryrun", false, "Use this option to validate your data before uploading");

    addOption("predictSNVfunction", true,
            "Set argument to true (default) to predict SNV function and false otherwise. Variant Type must be SNV.");

    addOption(d);
    addOption(f);
    addOption(variantType);

    addOption(project);

}

From source file:ubic.gemma.apps.ExperimentalDesignImportCli.java

@SuppressWarnings("static-access")
@Override/* w w w. j  ava  2s. co m*/
protected void buildOptions() {

    Option expOption = OptionBuilder.isRequired().hasArg().withArgName("Expression experiment name")
            .withDescription(
                    "Expression experiment short name. Most tools recognize comma-delimited values given on the command line, "
                            + "and if this option is omitted, the tool will be applied to all expression experiments.")
            .withLongOpt("experiment").create('e');

    addOption(expOption);

    Option designFileOption = OptionBuilder.hasArg().isRequired().withArgName("Design file")
            .withDescription("Experimental design description file").withLongOpt("designFile").create('f');
    addOption(designFileOption);

    Option dryRunOption = OptionBuilder.create("dryrun");
    addOption(dryRunOption);
}

From source file:ubic.gemma.core.apps.DatabaseViewGeneratorCLI.java

@Override
protected void buildOptions() {
    super.buildStandardOptions();

    OptionBuilder.withDescription(//from w  ww.j a v  a 2  s . com
            "Will generate a zip file containing a summary of all accessible datasets in gemma");
    OptionBuilder.withLongOpt("dataset");
    Option datasetSummary = OptionBuilder.create('d');

    OptionBuilder.withDescription(
            "Will generate a zip file containing a summary of all the tissues in accessible datasets");
    OptionBuilder.withLongOpt("tissue");
    Option datasetTissueSummary = OptionBuilder.create('t');

    OptionBuilder.withDescription(
            "Will generate a zip file containing a summary of all the differential expressed genes in accessible datasets");
    OptionBuilder.withLongOpt("diffexpression");
    Option diffExpSummary = OptionBuilder.create('x');

    OptionBuilder.hasArg();
    OptionBuilder.withArgName("Limit number of datasets");
    OptionBuilder.withDescription("will impose a limit on how many datasets to process");
    OptionBuilder.withLongOpt("limit");
    Option limitOpt = OptionBuilder.create('l');

    this.addOption(datasetSummary);
    this.addOption(datasetTissueSummary);
    this.addOption(diffExpSummary);
    this.addOption(limitOpt);

}

From source file:ubic.gemma.core.apps.PazarLoaderCli.java

@Override
protected void buildOptions() {
    OptionBuilder.isRequired();// w w w. j  a  v a 2  s .  c o m
    OptionBuilder.withLongOpt("file");
    OptionBuilder.hasArg();
    super.addOption(OptionBuilder.create('f'));
}

From source file:yaphyre.app.YaPhyRe.java

private static Options createCommandLineOptions() {
    Options options = new Options();

    OptionBuilder.withArgName("scene file");
    OptionBuilder.withDescription("Scene file to render");
    OptionBuilder.hasArg();/*  ww  w .ja  v  a 2  s .  c  om*/
    OptionBuilder.isRequired();
    options.addOption(OptionBuilder.create(COMMANDLINE_OPTION_SCENE_FILE));

    OptionBuilder.withArgName("<sampler name> [number of samples]");
    OptionBuilder.withDescription("The Sampler to use for the camera (single, regular, stratified, halton)");
    OptionBuilder.hasArgs(2);
    OptionBuilder.isRequired();
    options.addOption(OptionBuilder.create(COMMANDLINE_OPTION_CAMERA_SAMPLER));

    OptionBuilder.withArgName("gamma value");
    OptionBuilder.withDescription("Optional gamma correction");
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    options.addOption(OptionBuilder.create(COMMANDLINE_OPTION_GAMMA));

    return options;
}