diff --git a/src/main/java/org/jboss/jandex/Main.java b/src/main/java/org/jboss/jandex/Main.java index c4c49159..b11eeeef 100644 --- a/src/main/java/org/jboss/jandex/Main.java +++ b/src/main/java/org/jboss/jandex/Main.java @@ -40,6 +40,7 @@ public class Main { private boolean modify; private boolean verbose; private boolean dump; + private boolean jarFile; private File outputFile; private File source; @@ -68,7 +69,7 @@ private void execute(String[] args) { long start = System.currentTimeMillis(); Indexer indexer = new Indexer(); - Result result = (source.isDirectory()) ? indexDirectory(source, indexer) : JarIndexer.createJarIndex(source, indexer,modify,false,verbose); + Result result = (source.isDirectory()) ? indexDirectory(source, indexer) : JarIndexer.createJarIndex(source, indexer,modify,jarFile,verbose); double time = (System.currentTimeMillis() - start) / 1000.00; System.out.printf("Wrote %s in %.4f seconds (%d classes, %d annotations, %d instances, %d bytes)\n", result.getName(), time, result.getClasses(), result.getAnnotations(), result.getInstances(), result.getBytes()); } catch (Exception e) { @@ -166,6 +167,7 @@ private static void printUsage() { System.out.println(" -v verbose output"); System.out.println(" -m modify directory or jar instead of creating an external index file"); System.out.println(" -o name the external index file file-name"); + System.out.println(" -j export the index file to a jar file"); System.out.println(" -d dump the index file index-file-name"); System.out.println("\nThe default behavior, with no options specified, is to autogenerate an external index file"); } @@ -200,6 +202,10 @@ private void parseOptions(String[] args) { verbose = true; optionCount++; break; + case 'j': + jarFile = true; + optionCount++; + break; case 'o': if (i >= args.length) throw new IllegalArgumentException("-o reuires an output file name");