Split arguments into a Vec

This commit is contained in:
~karx 2021-03-16 12:38:36 -05:00 committed by Yash
parent 9e1f68801f
commit d11d5ce755
No known key found for this signature in database
GPG Key ID: A794DA2529474BA5
1 changed files with 5 additions and 1 deletions

View File

@ -140,7 +140,11 @@ impl Program {
builder
}
fn run_external(&mut self, filename: String) {
fn run_external(&mut self, arguments: String) {
let argument_vec: Vec<&str> = arguments.split("-").collect();
println!("{}", argument_vec.len());
let filename = argument_vec[0];
// Read contents of the provided file and construct a symbolic Program from it
let contents = fs::read_to_string(filename).expect("Something went wrong reading the file");
let mut prog = Program::from_string(contents);