Proof of concept: it is really possible to render classes
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / CommandlineConfiguration.java
1 package eu.svjatoslav.inspector.java;
2
3 import eu.svjatoslav.commons.commandline.parameterparser.Parser;
4 import eu.svjatoslav.commons.commandline.parameterparser.parameter.FileParameter;
5 import eu.svjatoslav.commons.commandline.parameterparser.parameter.StringParameter;
6 import eu.svjatoslav.commons.commandline.parameterparser.parameter.StringParameters;
7
8 public class CommandlineConfiguration {
9
10     public FileParameter jarFile;
11     public StringParameter graphName;
12
13     public CommandlineConfiguration (String args[]){
14         Parser parser = buildCommandlineParameterParser();
15         if (!parser.parse(args)) {
16             parser.showHelp();
17             return;
18         }
19
20     }
21
22     public Parser buildCommandlineParameterParser() {
23         Parser parser = new Parser();
24
25         jarFile = parser.add(
26                 new FileParameter("JAR file"))
27                 .mustExist()
28                 .addAliases("-j");
29
30         graphName = parser.add(
31                 new StringParameter("graph name"))
32                 .setMandatory()
33                 .addAliases("-n");
34
35         parser.add(
36                 new StringParameters("whitelist glob"))
37                 .addAliases("-w");
38
39         parser.add(
40                 new StringParameters("blacklist glob"))
41                 .addAliases("-b");
42
43         return parser;
44     }
45
46 }