use std::{env, fs}; fn main() { match run() { Ok(()) => { std::process::exit(0); } Err(e) => { eprintln!("Error: {}", e); std::process::exit(1); } }; } fn run() -> eonlib::EonResult<()> { let args: Vec = env::args().collect(); let filename = args.get(1).ok_or("no filename given")?; let contents = fs::read_to_string(filename).map_err(|_| "error reading file")?; eonlib::run(&contents)?; Ok(()) }