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

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

Introduction

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

Prototype

public static OptionBuilder isRequired() 

Source Link

Document

The next Option created will be required.

Usage

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

@Override
protected void buildOptions() {
    OptionBuilder.isRequired();
    OptionBuilder.hasArg();/*from  ww  w  .  j  av a 2  s . com*/
    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.ArrayDesignMergeCli.java

@SuppressWarnings("static-access")
@Override/* w w  w  . j  a va 2  s.  c  o m*/
protected void buildOptions() {
    super.buildOptions();
    Option otherArrayDesignOption = OptionBuilder.isRequired().hasArg().withArgName("Other platforms")
            .withDescription(
                    "Short name(s) of arrays to merge with the one given to the -a option, preferably subsumed by it, comma-delimited. "
                            + "If the platform given with -a is already a merged design, these will be added to it if the -add option is given"
                            + "The designs cannot be ones already merged into another design, but they can be mergees.")
            .withLongOpt("other").create('o');

    addOption(otherArrayDesignOption);

    Option newAdName = OptionBuilder.hasArg().withArgName("name")
            .withDescription("Name for new platform, if the given platform is not already a merged design")
            .withLongOpt("name").create('n');
    addOption(newAdName);
    Option newAdShortName = OptionBuilder.hasArg().withArgName("name")
            .withDescription(
                    "Short name for new platform, if the given platform is not already a merged design")
            .withLongOpt("shortname").create('s');
    addOption(newAdShortName);

    Option addOption = OptionBuilder
            .withDescription("If the given platform is already a merged design, add the -o designs to it. "
                    + "Recommended unless there is a specific reason to create a new design.")
            .create("add");
    addOption(addOption);
}

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

@SuppressWarnings("static-access")
@Override/* w w w. ja va2  s .  c o  m*/
protected void buildOptions() {
    super.buildOptions();
    addOption(OptionBuilder.isRequired().hasArg().withArgName("file")
            .withDescription("Two-column file with old and new identifiers (additional columns ignored)")
            .create('f'));
}

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

@SuppressWarnings("static-access")
@Override//ww  w.  j av a 2 s  . com
protected void buildOptions() {
    super.buildOptions();
    Option otherArrayDesignOption = OptionBuilder.isRequired().hasArg().withArgName("Other platform")
            .withDescription("Short name(s) of platforms to compare to the first one, comma-delimited")
            .withLongOpt("other").create('o');

    addOption(otherArrayDesignOption);
}

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

@SuppressWarnings("static-access")
@Override// w  ww. j  a va2s  .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.apps.LoadSimpleExpressionDataCli.java

@SuppressWarnings("static-access")
@Override/*  ww w .  ja  v a 2  s  . c o  m*/
protected void buildOptions() {
    Option fileOption = OptionBuilder.isRequired().hasArg().withArgName("File Name")
            .withDescription("the list of experiments in flat file").withLongOpt("file").create('f');
    addOption(fileOption);

    Option dirOption = OptionBuilder.hasArg().withArgName("File Folder")
            .withDescription("The folder for containing the experiment files").withLongOpt("dir").create('d');
    addOption(dirOption);

}

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

@SuppressWarnings("static-access")
@Override//  w w  w  .ja v  a2  s.c o  m
protected void buildOptions() {
    Option fileOption = OptionBuilder.isRequired().hasArg().withArgName("Id file")
            .withDescription("List of pubmed ids").withLongOpt("file").create('f');
    this.addOption(fileOption);

    this.addOption(OptionBuilder.withDescription("Use major subjects only").create('m'));

}

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

@SuppressWarnings("static-access")
@Override/*from   ww  w  .j ava2s  .com*/
protected void buildOptions() {
    addOption(OptionBuilder.isRequired().hasArg().withArgName("url")
            .withDescription("Base URL for the OWL file").withLongOpt("url").create("o"));

    addOption(OptionBuilder.withDescription("Force reloading of Ontology in Database").withLongOpt("force")
            .create("f"));

    addOption(OptionBuilder.withDescription("Load from file").withLongOpt("file").create("l"));

}

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

@SuppressWarnings("static-access")
@Override/* w  w w. j ava2 s .  c  om*/
protected void buildOptions() {
    super.addOption(OptionBuilder.isRequired().withLongOpt("file").hasArg().create('f'));
}

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

@SuppressWarnings("static-access")
@Override/*from www . jav  a2 s. c  om*/
protected void buildOptions() {
    Option fileOption = OptionBuilder.isRequired().hasArg().withArgName("Directory")
            .withDescription("Directory of PubMed XML files to load").withLongOpt("dir").create('d');
    this.addOption(fileOption);

}