code cleanup and minor bug fixes
This commit is contained in:
parent
090c8dfc28
commit
f2703fb43f
|
@ -16,8 +16,7 @@ public class Main {
|
||||||
boolean help_enqueued = false;
|
boolean help_enqueued = false;
|
||||||
boolean allow_networking = true;
|
boolean allow_networking = true;
|
||||||
String matrix_file_name = "";
|
String matrix_file_name = "";
|
||||||
int verbosity = 1;
|
|
||||||
|
|
||||||
int p = 0;
|
int p = 0;
|
||||||
while (p < args.length) {
|
while (p < args.length) {
|
||||||
try {
|
try {
|
||||||
|
@ -25,10 +24,6 @@ public class Main {
|
||||||
help_enqueued = true;
|
help_enqueued = true;
|
||||||
p += 1;
|
p += 1;
|
||||||
}
|
}
|
||||||
else if (Objects.equals(args[p], "-v")) {
|
|
||||||
verbosity = Integer.parseInt(args[p+1]);
|
|
||||||
p += 2;
|
|
||||||
}
|
|
||||||
else if (Objects.equals(args[p], "--offline")) {
|
else if (Objects.equals(args[p], "--offline")) {
|
||||||
allow_networking = false;
|
allow_networking = false;
|
||||||
p += 2;
|
p += 2;
|
||||||
|
@ -115,7 +110,7 @@ public class Main {
|
||||||
Scanner help_file_scanner = new Scanner(help_file);
|
Scanner help_file_scanner = new Scanner(help_file);
|
||||||
|
|
||||||
while (help_file_scanner.hasNextLine()) {
|
while (help_file_scanner.hasNextLine()) {
|
||||||
System.out.print(help_file_scanner.nextLine());
|
System.out.println(help_file_scanner.nextLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
help_file_scanner.close();
|
help_file_scanner.close();
|
||||||
|
@ -144,18 +139,14 @@ public class Main {
|
||||||
int[][] baked_matrix = new int[baked_matrix_lines.size()][ref_length];
|
int[][] baked_matrix = new int[baked_matrix_lines.size()][ref_length];
|
||||||
|
|
||||||
for (int i = 0; i < baked_matrix_lines.size(); i++) {
|
for (int i = 0; i < baked_matrix_lines.size(); i++) {
|
||||||
//for (String[] sa : baked_matrix_lines) {
|
|
||||||
if (baked_matrix_lines.get(i).length != ref_length) {
|
if (baked_matrix_lines.get(i).length != ref_length) {
|
||||||
System.err.println("[ERROR] Matrix lines have different length! Assuming the matrix was corrupted");
|
System.err.println("[ERROR] Matrix lines have different length! Assuming the matrix was corrupted");
|
||||||
System.exit(2);
|
System.exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < baked_matrix_lines.get(i).length; j++) {
|
for (int j = 0; j < baked_matrix_lines.get(i).length; j++) {
|
||||||
//System.out.print(baked_matrix_lines.get(i)[j] + " ");
|
|
||||||
baked_matrix[i][j] = Integer.parseInt(baked_matrix_lines.get(i)[j]);
|
baked_matrix[i][j] = Integer.parseInt(baked_matrix_lines.get(i)[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//System.out.print("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return baked_matrix;
|
return baked_matrix;
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
Dummy help file
|
Usage: java Main [options] [matrix_file]
|
||||||
|
Options:
|
||||||
|
-h Output this help text
|
||||||
|
--offline Prevent any possible attempt to fetch missing files from the server
|
||||||
|
|
Loading…
Reference in New Issue