57 lines
1.7 KiB
Java
57 lines
1.7 KiB
Java
package de.vanitasvitae.imi.codes;
|
|
|
|
import org.apache.commons.cli.Option;
|
|
import org.apache.commons.cli.Options;
|
|
|
|
public class Arguments {
|
|
|
|
static final Option STUDY_NUMBER = Option.builder("s")
|
|
.longOpt("study")
|
|
.desc("Three-letter code of the associated study")
|
|
.required()
|
|
.hasArg()
|
|
.argName("SNR")
|
|
.build();
|
|
|
|
static final Option SAMPLE_TYPE = Option.builder("t")
|
|
.longOpt("type")
|
|
.desc("Type of the sample (b = blood, u = urine)")
|
|
.required(true)
|
|
.hasArg()
|
|
.argName("sample type")
|
|
.build();
|
|
|
|
static final Option OUTPUT_DESTINATION = Option.builder("o")
|
|
.longOpt("OUTPUT_DESTINATION")
|
|
.desc("Filename for the generated html output")
|
|
.hasArg()
|
|
.argName("file name")
|
|
.build();
|
|
|
|
static final Option EXTERNAL_BROWSER = Option.builder("b")
|
|
.longOpt("EXTERNAL_BROWSER")
|
|
.desc("Open the generated HTML output in a an external browser")
|
|
.build();
|
|
|
|
static final Option HELP = Option.builder("h")
|
|
.longOpt("help")
|
|
.desc("Print this help text")
|
|
.build();
|
|
/**
|
|
* Assemble and return the available command line options.
|
|
*
|
|
* @return command line options.
|
|
*/
|
|
public static Options getCommandLineOptions() {
|
|
Options options = new Options();
|
|
|
|
options.addOption(STUDY_NUMBER);
|
|
options.addOption(SAMPLE_TYPE);
|
|
options.addOption(OUTPUT_DESTINATION);
|
|
options.addOption(EXTERNAL_BROWSER);
|
|
options.addOption(HELP);
|
|
|
|
return options;
|
|
}
|
|
}
|