mod cli;
mod commands;
mod error;
mod io;
mod paths;
mod picker;
mod provision;
mod runtime;
mod ssh;
mod state;
mod tart;
use std::process::ExitCode;
use clap::Parser;
fn main() -> ExitCode {
let args = cli::Cli::parse();
if let Some(path) = args.log.as_deref() {
if let Err(e) = io::setup_log_tee(path) {
eprintln!("rusta: failed to set up --log tee to {}: {}", path, e);
return ExitCode::from(1);
}
}
io::set_verbose(args.verbose);
let code = match commands::dispatch(args) {
Ok(code) => code,
Err(e) => {
io::err(&format!("{}", e));
e.exit_code()
}
};
ExitCode::from(code)
}