code cleanup and minor bug fixes

This commit is contained in:
dymik739 2023-03-18 11:42:01 +02:00
parent 090c8dfc28
commit f2703fb43f
2 changed files with 6 additions and 12 deletions

View File

@ -16,7 +16,6 @@ public class Main {
boolean help_enqueued = false;
boolean allow_networking = true;
String matrix_file_name = "";
int verbosity = 1;
int p = 0;
while (p < args.length) {
@ -25,10 +24,6 @@ public class Main {
help_enqueued = true;
p += 1;
}
else if (Objects.equals(args[p], "-v")) {
verbosity = Integer.parseInt(args[p+1]);
p += 2;
}
else if (Objects.equals(args[p], "--offline")) {
allow_networking = false;
p += 2;
@ -115,7 +110,7 @@ public class Main {
Scanner help_file_scanner = new Scanner(help_file);
while (help_file_scanner.hasNextLine()) {
System.out.print(help_file_scanner.nextLine());
System.out.println(help_file_scanner.nextLine());
}
help_file_scanner.close();
@ -144,18 +139,14 @@ public class Main {
int[][] baked_matrix = new int[baked_matrix_lines.size()][ref_length];
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) {
System.err.println("[ERROR] Matrix lines have different length! Assuming the matrix was corrupted");
System.exit(2);
}
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]);
}
//System.out.print("\n");
}
return baked_matrix;

View File

@ -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