command line argument for program
This commit is contained in:
parent
c688bf63ea
commit
0597b1d4f8
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user