diff --git a/app/src/main/java/Main.java b/app/src/main/java/Main.java index f6364c4..436e63e 100644 --- a/app/src/main/java/Main.java +++ b/app/src/main/java/Main.java @@ -6,16 +6,15 @@ public class Main { // Get commandline arguments // Checks that only the file has been declared - // TODO Add arguments to read files from -// if (args.length != 1) { -// System.out.println("Invalid arguments, you need to define the text file to read from!"); -// return; -// } -// -// System.out.println(Arrays.toString(args)); + if (args.length != 1) { + System.out.println("Invalid arguments, you need to define the text file to read from!"); + return; + } + + Path filePath = Path.of(args[0]); // Get the data from the file - List data = ReadFile.open(Path.of("example.txt")); + List data = ReadFile.open(filePath); // Gets a map with the total occurrences for each domain Map domains = getDomainTotal(data);