Added reference to Tony Bargnesi github page.
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / Main.java
1 package eu.svjatoslav.inspector.java;
2
3 import eu.svjatoslav.inspector.java.structure.ClassGraph;
4
5 import static java.io.File.separator;
6 import static java.lang.System.getProperty;
7
8 /**
9  * This class acts as a commandline interface for JavaInspect.
10  */
11 public class Main {
12         public static void main(String[] args) {
13                 if (args.length == 0) {
14                         System.err.println("usage: javainspect [PROJECT_DIR] [PACKAGE_GLOB] [GRAPH_NAME]");
15                         System.exit(1);
16                 }
17
18                 String projectDir  = args[0];
19                 String packageGlob = args[1];
20                 String graphName   = args[2];
21
22                 ClassGraph cg = new ClassGraph();
23                 cg.setTargetDirectoryPath(getProperty("user.dir") + separator);
24
25                 cg.addProject(projectDir);
26                 cg.whitelistClassGlob(packageGlob);
27                 cg.setKeepDotFile(true);
28                 cg.generateGraph(graphName);
29         }
30 }