mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
Add arg parsing, support multiple worlds
This commit is contained in:
parent
83f35e51ee
commit
129585ba64
5 changed files with 140 additions and 22 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue