use schala_repl::{run_noninteractive, start_repl, ProgrammingLanguageInterface}; use std::process::exit; fn main() { let args: Vec = std::env::args().collect(); let matches = command_line_options() .parse(&args[1..]) .unwrap_or_else(|e| { eprintln!("Error parsing options: {}", e); exit(1); }); if matches.opt_present("help") { println!("{}", command_line_options().usage("Schala metainterpreter")); exit(0); } let langs: Vec> = vec![Box::new(schala_lang::Schala::new())]; if matches.free.is_empty() { start_repl(langs); } else { run_noninteractive(&matches.free[0], langs); } } fn command_line_options() -> getopts::Options { let mut options = getopts::Options::new(); options.optflag("h", "help", "Show help text"); options.optflag("w", "webapp", "Start up web interpreter"); options }