DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option inputOpt = obuilder.withLongName("dir")
.withRequired(true)
.withArgument(
abuilder.withName("dir")
.withMinimum(1)
.withMaximum(1).create())
.withDescription("Lucene index directory containing input data")
.withShortName("d").create();
Option categoryOpt = obuilder.withLongName("categories")
.withRequired(true)
.withArgument(
abuilder.withName("file")
.withMinimum(1)
.withMaximum(1).create())
.withDescription("File containing a list of categories")
.withShortName("c").create();
Option outputOpt = obuilder.withLongName("output")
.withRequired(false)
.withArgument(
abuilder.withName("output")
.withMinimum(1)
.withMaximum(1).create())
.withDescription("Output directory")
.withShortName("o").create();
Option categoryFieldsOpt =
obuilder.withLongName("category-fields")
.withRequired(true)
.withArgument(
abuilder.withName("fields")
.withMinimum(1)
.withMaximum(1)
.create())
.withDescription("Fields to match categories against (comma-delimited)")
.withShortName("cf").create();
Option textFieldsOpt =
obuilder.withLongName("text-fields")
.withRequired(true)
.withArgument(
abuilder.withName("fields")
.withMinimum(1)
.withMaximum(1)
.create())
.withDescription("Fields from which to extract training text (comma-delimited)")
.withShortName("tf").create();
Option useTermVectorsOpt = obuilder.withLongName("use-term-vectors")
.withDescription("Extract term vectors containing preprocessed data " +
"instead of unprocessed, stored text values")
.withShortName("tv").create();
Option helpOpt = obuilder.withLongName("help")
.withDescription("Print out help")
.withShortName("h").create();
Group group = gbuilder.withName("Options")
.withOption(inputOpt)