Add arg parsing, support multiple worlds

This commit is contained in:
crumblingstatue 2023-04-12 22:18:52 +02:00
parent 83f35e51ee
commit 129585ba64
5 changed files with 140 additions and 22 deletions

View file

@ -13,10 +13,18 @@ mod world;
mod worldgen;
use app::App;
use clap::Parser;
#[derive(Parser)]
pub struct CliArgs {
#[arg(default_value = "TestWorld")]
world_name: String,
}
fn try_main() -> anyhow::Result<()> {
gamedebug_core::set_enabled(true);
let mut app = App::new()?;
let cli_args = CliArgs::parse();
let mut app = App::new(cli_args)?;
app.do_game_loop();
Ok(())
}