diff --git a/src/Interpreter.java b/src/Interpreter.java index 991be3ba43984986f5cb06d3517904446bd6b4cf..83919348a89894820626399147801edc0cc646f5 100644 --- a/src/Interpreter.java +++ b/src/Interpreter.java @@ -7,9 +7,16 @@ import java.util.*; */ public class Interpreter { public static void main(String[] args) { + // spaces define new arguments, and as the program only takes 1, the file name, we can safely concatenate them + // into 1 string, adding spaces where the command line has split it + StringBuilder fileString = new StringBuilder(); + for (String s : args) { + fileString.append(s); + fileString.append(" "); + } try { // reading the file - File filePath = new File("C:\\Users\\alist\\IdeaProjects\\Space Cowboys\\src\\program.bb"); + File filePath = new File(fileString.toString()); Scanner reader = new Scanner(filePath); StringBuilder data = new StringBuilder(); // moves the file into a string @@ -33,7 +40,8 @@ public class Interpreter { } catch (FileNotFoundException e){ System.out.println("File can't be found."); - e.printStackTrace(); + e.printStackTrace(); + // System.exit(1); } } }