// input options
Option sourceOption = OptionBuilder.withArgName("SOURCE FILE").hasArg().withDescription("source file")
.create('s');
OptionGroup inputOptionGroup = new OptionGroup();
inputOptionGroup.addOption(helpOption);
inputOptionGroup.addOption(sourceOption);
inputOptionGroup.isRequired();
Option targetOption = OptionBuilder.withArgName("TARGET FILE").hasArg().withDescription("target file")
.create('t');
// general options
Option linesOption = OptionBuilder.withArgName("LINES").hasArg().withDescription("lines to use").create('l');
Option regexOption = OptionBuilder.withArgName("TOKENIZER REGEX").hasArg().withDescription("regex for tokens")
.withLongOpt("tok").create();
Option regexFileOption = OptionBuilder.withArgName("TOKENIZER REGEX FILE").hasArg()
.withDescription("regex file for tokens").withLongOpt("tokfile").create();
Option stopOption = OptionBuilder.withArgName("STOPWORD FILE").hasArg().withDescription("stopword file")
.withLongOpt("stop").create();
Option srcStopOption = OptionBuilder.withArgName("SOURCE STOPWORD FILE").hasArg()
.withDescription("source stopword file").withLongOpt("sstop").create();
Option dstStopOption = OptionBuilder.withArgName("TARGET STOPWORD FILE").hasArg()
.withDescription("target stopword file").withLongOpt("tstop").create();
Option separatorOption = OptionBuilder.withArgName("SEPARATOR FILE").hasArg().withDescription("separator file")
.withLongOpt("sep").create();
Option srcSeparatorOption = OptionBuilder.withArgName("SOURCE SEPARATOR FILE").hasArg()
.withDescription("source separator file").withLongOpt("ssep").create();
Option dstSeparatorOption = OptionBuilder.withArgName("TARGET SEPARATOR FILE").hasArg()
.withDescription("target separator file").withLongOpt("tsep").create();
Option depthOption = OptionBuilder.withArgName("DEPTH").hasArg().withDescription("gappy phrase depth")
.withLongOpt("depth").create("d");
Option maxDepthOption = OptionBuilder.withArgName("MAX DEPTH").hasArg()
.withDescription("max gappy phrase depth").withLongOpt("max-depth").create("m");
Option srcDepthOption = OptionBuilder.withArgName("SOURCE DEPTH").hasArg()
.withDescription("source gappy phrase depth").withLongOpt("src-depth").create("sd");
Option srcMaxDepthOption = OptionBuilder.withArgName("SOURCE MAX DEPTH").hasArg()
.withDescription("max source gappy phrase depth").withLongOpt("src-max-depth").create("sm");
Option dstDepthOption = OptionBuilder.withArgName("TARGET DEPTH").hasArg()
.withDescription("target gappy phrase depth").withLongOpt("trg-depth").create("td");
Option dstMaxDepthOption = OptionBuilder.withArgName("TARGET MAX DEPTH").hasArg()
.withDescription("max target gappy phrase depth").withLongOpt("trg-max-depth").create("tm");
Option wsizeOption = OptionBuilder.withArgName("WINDOW SIZE").hasArg()
.withDescription("window size of a gappy phrase").withLongOpt("wsize").create("w");
Option cratioOption = OptionBuilder.withArgName("MIN CONTEXT RATIO").hasArg()
.withDescription("minimal left/right ratio").withLongOpt("cratio").create();
Option nfillOption = OptionBuilder.withArgName("MIN NON-EMPTY FILLERS").hasArg()
.withDescription("minimal non-empty fillers count").withLongOpt("nfill").create();
Option delOption = OptionBuilder.withArgName("DELIMITER").hasArg().withDescription("delimiter for printing")
.withLongOpt("del").create();
// alignment related options
Option simOption = OptionBuilder.withArgName("MIN SIMILARITY").hasArg().withDescription("minimal similarity")
.withLongOpt("sim").create();
Option numOption = OptionBuilder.withArgName("ALIGNMENTS").hasArg().withDescription("number of top alignments")
.create('n');
Option vsizeOption = OptionBuilder.withArgName("VECTOR SIZE").hasArg().withDescription("minimal vector size")
.withLongOpt("vsize").create();
Option maxOption = OptionBuilder.withDescription("output only maximal repeats").withLongOpt("max").create();
Option smaxOption = OptionBuilder.withDescription("output only supermaximal repeats").withLongOpt("smax")
.create();
Option verboseOption = OptionBuilder.withDescription("verbose").create('v');
Option laTeXOption = OptionBuilder.withDescription("output LaTeX when possible").create('x');
// actions
OptionGroup actionOptionGroup = new OptionGroup();
actionOptionGroup.addOption(OptionBuilder.withDescription("print allignments").create('a'));
actionOptionGroup.addOption(OptionBuilder.withDescription("print corpus info").create('i'));
actionOptionGroup.addOption(OptionBuilder.withDescription("print tokens").create('z'));
actionOptionGroup.addOption(OptionBuilder.withDescription("print repeats").create('r'));
actionOptionGroup.isRequired();
options.addOptionGroup(inputOptionGroup);
options.addOptionGroup(actionOptionGroup);
options.addOption(targetOption);
options.addOption(linesOption);