public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option dumpFileOpt = obuilder.withLongName("dumpFile").withRequired(true).withArgument(
abuilder.withName("dumpFile").withMinimum(1).withMaximum(1).create()).withDescription(
"The path to the wikipedia dump file (.bz2 or uncompressed)").withShortName("d").create();
Option outputDirOpt = obuilder.withLongName("outputDir").withRequired(true).withArgument(
abuilder.withName("outputDir").withMinimum(1).withMaximum(1).create()).withDescription(
"The output directory to place the splits in:\n"
+ "local files:\n\t/var/data/wikipedia-xml-chunks or\n\tfile:///var/data/wikipedia-xml-chunks\n"
+ "Hadoop DFS:\n\thdfs://wikipedia-xml-chunks\n"
+ "AWS S3 (blocks):\n\ts3://bucket-name/wikipedia-xml-chunks\n"
+ "AWS S3 (native files):\n\ts3n://bucket-name/wikipedia-xml-chunks\n")
.withShortName("o").create();
Option s3IdOpt = obuilder.withLongName("s3ID").withRequired(false).withArgument(
abuilder.withName("s3Id").withMinimum(1).withMaximum(1).create()).withDescription("Amazon S3 ID key")
.withShortName("i").create();
Option s3SecretOpt = obuilder.withLongName("s3Secret").withRequired(false).withArgument(
abuilder.withName("s3Secret").withMinimum(1).withMaximum(1).create()).withDescription(
"Amazon S3 secret key").withShortName("s").create();
Option chunkSizeOpt = obuilder.withLongName("chunkSize").withRequired(true).withArgument(
abuilder.withName("chunkSize").withMinimum(1).withMaximum(1).create()).withDescription(
"The Size of the chunk, in megabytes").withShortName("c").create();
Option numChunksOpt = obuilder
.withLongName("numChunks")
.withRequired(false)
.withArgument(abuilder.withName("numChunks").withMinimum(1).withMaximum(1).create())
.withDescription(
"The maximum number of chunks to create. If specified, program will only create a subset of the chunks")