Source:
public static void main(String[] args) { CFGVisualizeLauncher cfgVisualizeLauncher = new CFGVisualizeLauncher(); if (args.length < 1) { cfgVisualizeLauncher.printUsage(); System.exit(1); } String input = args[0]; File file = new File(input); if (!file.canRead()) { cfgVisualizeLauncher.printError("Cannot read input file: " + file.getAbsolutePath()); cfgVisualizeLauncher.printUsage(); System.exit(1); } String method = "test"; String clas = "Test"; String output = "."; boolean pdf = false; boolean error = false; boolean verbose = false; boolean string = false; for (int i = 1; i < args.length; i++) { switch (args[i]) { case "-output": if (i >= args.length - 1) { cfgVisualizeLauncher.printError("Did not find <outputdir> after -output."); continue; } i++; output = args[i]; break; case "-pdf": pdf = true; break; case "-method": if (i >= args.length - 1) { cfgVisualizeLauncher.printError("Did not find <name> after -method."); continue; } i++; method = args[i]; break; case "-class": if (i >= args.length - 1) { cfgVisualizeLauncher.printError("Did not find <name> after -class."); continue; } i++; clas = args[i]; break; case "-verbose": verbose = true; break; case "-string": string = true; break; default: cfgVisualizeLauncher.printError("Unknown command line argument: " + args[i]); error = true; break; } } if (error) { System.exit(1); } if (!string) { cfgVisualizeLauncher.generateDOTofCFGWithoutAnalysis( input, output, method, clas, pdf, verbose); } else { String stringGraph = cfgVisualizeLauncher.generateStringOfCFGWithoutAnalysis( input, method, clas, verbose); System.out.println(stringGraph); } }

Target:
public static void main(String[] args) { CFGVisualizeLauncher cfgVisualizeLauncher = new CFGVisualizeLauncher(); if (args.length == 0) { cfgVisualizeLauncher.printUsage(); System.exit(1); } String input = args[0]; File file = new File(input); if (!file.canRead()) { cfgVisualizeLauncher.printError("Cannot read input file: " + file.getAbsolutePath()); cfgVisualizeLauncher.printUsage(); System.exit(1); } String method = "test"; String clas = "Test"; String output = "."; boolean pdf = false; boolean error = false; boolean verbose = false; boolean string = false; for (int i = 1; i < args.length; i++) { switch (args[i]) { case "--outputdir": if (i >= args.length - 1) { cfgVisualizeLauncher.printError( "Did not find <outputdir> after --outputdir."); continue; } i++; output = args[i]; break; case "--pdf": pdf = true; break; case "--method": if (i >= args.length - 1) { cfgVisualizeLauncher.printError("Did not find <name> after --method."); continue; } i++; method = args[i]; break; case "--class": if (i >= args.length - 1) { cfgVisualizeLauncher.printError("Did not find <name> after --class."); continue; } i++; clas = args[i]; break; case "--verbose": verbose = true; break; case "--string": string = true; break; default: cfgVisualizeLauncher.printError("Unknown command line argument: " + args[i]); error = true; break; } } if (error) { System.exit(1); } if (!string) { cfgVisualizeLauncher.generateDOTofCFGWithoutAnalysis( input, output, method, clas, pdf, verbose); } else { String stringGraph = cfgVisualizeLauncher.generateStringOfCFGWithoutAnalysis( input, method, clas, verbose); System.out.println(stringGraph); } }