//! Orrery: an ASCII sci-fi-fantasy game. //! //! `orrery` plays; `orrery names` and `orrery ship` print what the //! generators make, without the TUI. mod app; mod cli; mod dungeon; mod names; mod scenes; mod seed; mod term; use std::process::ExitCode; fn main() -> ExitCode { let args: Vec = std::env::args().skip(1).collect(); match cli::parse(&args) { Ok(cli::Command::Play { seed }) => match app::run(seed.unwrap_or_else(seed::from_clock)) { Ok(()) => ExitCode::SUCCESS, Err(e) => { eprintln!("orrery: {e}"); ExitCode::FAILURE } }, Ok(cli::Command::Names(opts)) => { cli::print_names(&opts); ExitCode::SUCCESS } Ok(cli::Command::Ship { seed, which }) => { cli::print_ship(seed, which); ExitCode::SUCCESS } Ok(cli::Command::Help) => { print!("{}", cli::USAGE); ExitCode::SUCCESS } Err(msg) => { eprintln!("orrery: {msg}\n\n{}", cli::USAGE); ExitCode::from(2) } } }