use std::{env, fs, process}; use avid::Builder; fn main() { let mut args = env::args(); let name = args.next().unwrap(); let filepath = args.next().map(|x| { ( fs::read_to_string(&x).expect("Could not read from file!"), x, ) }); if let Some((src, fname)) = filepath { let avid = Builder::new(&src) .allow_stack_debug(true) .src_name(fname) .build() .unwrap(); avid.run(None).unwrap(); } else { eprintln!("Usage: {name} "); process::exit(1); } }