command line argument for program

This commit is contained in:
dogeystamp 2024-01-06 14:05:41 -05:00
parent c688bf63ea
commit 0597b1d4f8
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -4,10 +4,12 @@
mod vm;
use crate::vm::VM;
use std::env;
fn main() {
let mut vm = VM::new();
let args : Vec<_> = env::args().collect();
vm.read_program(&"programs/hello-world.obj".to_string());
let mut vm = VM::new();
vm.read_program(args.get(1).expect("No program file given"));
vm.execute();
}