@@ -21,41 +21,30 @@ public class Main {
2121 public static void main (String [] args ) {
2222
2323 try {
24- boolean correctNumberOfArguments = args .length >= 2 && args .length <= 4 ;
25- if (!correctNumberOfArguments ) {
24+ if (args .length != 4 ) {
2625 System .err .println ("" );
2726 System .err .println (
28- "Usage: java de.fraunhofer.iem.swan.Main <source-dir> [ <train-sourcecode>] [ <train-json>] <output-dir>\n " );
27+ "Usage: java de.fraunhofer.iem.swan.Main <source-dir> <train-sourcecode> <train-json> <output-dir>\n " );
2928 System .err .println ("<source-dir>:\t Directory with all JAR files or source code of the Test Data." );
3029 System .err .println ("\t \t This is the actual user library being evaluated.\n " );
3130 System .err .println (
32- "<train-sourcecode>: Directory with all JAR Files or source code of the Train Data to learn from. " );
31+ "<train-sourcecode>: Directory with all JAR Files or source code of the Train Data to learn from" );
3332 System .err .println (
34- "\t \t This is an optional parameter. If it is not specified, the builtin traindata is used .\n " );
33+ "\t \t Note: This can be set to \" internal \" without quotes, to use the internal train sourcecode that is bundled in this jar .\n " );
3534 System .err
3635 .println ("<train-json>: Path to the train data file (JSON), which includes method signatures." );
3736 System .err .println (
38- "\t \t This is an optional parameter. If it is not specified, the builtin json file is used .\n " );
37+ "\t \t Note: This can be set to \" internal \" (without quotes), to use the internal train data file that is bundled in this jar .\n " );
3938 System .err .println ("<output-dir>:\t Directory where the output should be written.\n " );
4039 return ;
4140 }
4241
4342 // Get configuration options from command line arguments.
4443 String sourceDir = args [0 ];
45- String trainSourceCode = null ;
46- String trainJson = null ;
47- String outputDir = args [args .length - 1 ];
48-
49- // Train Sourcecode (extract from JAR, if not specified)
50- if (args .length >= 3 ) {
51- trainSourceCode = args [1 ];
52- }
53-
54- // Train JSON (extract from JAR, if not specified)
55- if (args .length == 4 ) {
56- trainJson = args [2 ];
57- }
58-
44+ String trainSourceCode = args [1 ].equals ("internal" ) ? null : args [1 ];
45+ String trainJson = args [2 ].equals ("internal" ) ? null : args [2 ];
46+ String outputDir = args [3 ];
47+
5948 Main main = new Main ();
6049 main .run (sourceDir , trainSourceCode , trainJson , outputDir );
6150 // System.out.println("Done.");
0 commit comments