Search in sources :

Example 11 with OptionGroup

use of org.apache.commons.cli.OptionGroup in project goci by EBISPOT.

the class MappingApplication method bindOptions.

private Options bindOptions() {
    Options options = new Options();
    // help
    Option helpOption = new Option("h", "help", false, "Use -m option to run mapping on contents of GWAS catalog");
    options.addOption(helpOption);
    // options are...
    // -m do mapping
    OptionGroup modeGroup = new OptionGroup();
    modeGroup.setRequired(false);
    Option mappingOption = new Option("m", "mapping", false, "Maps all associations in the GWAS database. Mapping pipeline will map SNPs " + "in database and also validate the author reported gene linked to that SNP via the associations");
    mappingOption.setArgName("performer");
    mappingOption.setRequired(true);
    modeGroup.addOption(mappingOption);
    options.addOptionGroup(modeGroup);
    Option mappingOptionLSF = new Option("n", "NIGHT", false, "Maps all associations in the GWAS database. Mapping pipeline will map SNPs " + "in database and also validate the author reported gene linked to that SNP via the associations");
    mappingOptionLSF.setArgName("performer");
    mappingOptionLSF.setRequired(true);
    modeGroup.addOption(mappingOptionLSF);
    options.addOptionGroup(modeGroup);
    return options;
}
Also used : Options(org.apache.commons.cli.Options) OptionGroup(org.apache.commons.cli.OptionGroup) Option(org.apache.commons.cli.Option)

Example 12 with OptionGroup

use of org.apache.commons.cli.OptionGroup in project goci by EBISPOT.

the class ValidatorApplication method bindOptions.

private Options bindOptions() {
    Options options = new Options();
    // help
    Option helpOption = new Option("h", "help", false, "Use -a run author submission validation of your file, use -c to run curation level validation");
    options.addOption(helpOption);
    // options are...
    OptionGroup modeGroup = new OptionGroup();
    modeGroup.setRequired(true);
    OptionGroup validationGroup = new OptionGroup();
    modeGroup.setRequired(true);
    Option lightOption = new Option("a", "author checking", false, "Runs light checking over the uploaded association file, used mainly for author submission spreadsheets");
    lightOption.setRequired(false);
    validationGroup.addOption(lightOption);
    options.addOptionGroup(validationGroup);
    Option fullOption = new Option("c", "curator checking", false, "Runs full checking over the uploaded association file, used mainly for curator submission spreadsheets");
    fullOption.setRequired(false);
    validationGroup.addOption(fullOption);
    options.addOptionGroup(validationGroup);
    // add input file arguments
    OptionGroup fileGroup = new OptionGroup();
    fileGroup.setRequired(true);
    Option inOption = new Option("f", "file", true, "Input file - file containing association data to be validated");
    inOption.setArgName("file");
    inOption.setRequired(false);
    fileGroup.addOption(inOption);
    options.addOptionGroup(fileGroup);
    return options;
}
Also used : Options(org.apache.commons.cli.Options) OptionGroup(org.apache.commons.cli.OptionGroup) Option(org.apache.commons.cli.Option)

Example 13 with OptionGroup

use of org.apache.commons.cli.OptionGroup in project ignite by apache.

the class GridVmNodesStarter method createOptions.

/**
     * Creates cli options.
     *
     * @return Command line options
     */
private static Options createOptions() {
    Options options = new Options();
    OptionGroup grp = new OptionGroup();
    grp.setRequired(true);
    Option cfg = new Option(OPTION_CFG, null, true, "path to Spring XML configuration file.");
    cfg.setArgName("file");
    Option n = new Option(null, OPTION_N, true, "nodes count.");
    n.setValueSeparator('=');
    n.setType(Integer.class);
    grp.addOption(cfg);
    grp.addOption(n);
    options.addOptionGroup(grp);
    return options;
}
Also used : Options(org.apache.commons.cli.Options) OptionGroup(org.apache.commons.cli.OptionGroup) Option(org.apache.commons.cli.Option)

Example 14 with OptionGroup

use of org.apache.commons.cli.OptionGroup in project cdap by caskdata.

the class CLIMain method addOptionalOption.

private static void addOptionalOption(Options options, Option option) {
    OptionGroup optionalGroup = new OptionGroup();
    optionalGroup.setRequired(false);
    optionalGroup.addOption(option);
    options.addOptionGroup(optionalGroup);
}
Also used : OptionGroup(org.apache.commons.cli.OptionGroup)

Aggregations

OptionGroup (org.apache.commons.cli.OptionGroup)14 Option (org.apache.commons.cli.Option)13 Options (org.apache.commons.cli.Options)11 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 BasicParser (org.apache.commons.cli.BasicParser)1 CommandLine (org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.commons.cli.CommandLineParser)1 ParseException (org.apache.commons.cli.ParseException)1