From 0f76cc3d9078b18e509dc88899daf23102019335 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 10 Nov 2025 19:14:50 -0500 Subject: minimize dependencies & features --- game/Cargo.toml | 2 +- game/src/main.rs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'game') diff --git a/game/Cargo.toml b/game/Cargo.toml index b42d1c1..7b5668e 100644 --- a/game/Cargo.toml +++ b/game/Cargo.toml @@ -8,7 +8,7 @@ publish.workspace = true rust-version.workspace = true [dependencies] -clap.workspace = true +argh.workspace = true dungeon.workspace = true graphics.workspace = true diff --git a/game/src/main.rs b/game/src/main.rs index 53d17b7..6905fe3 100644 --- a/game/src/main.rs +++ b/game/src/main.rs @@ -1,4 +1,4 @@ -use clap::Parser; +use argh::FromArgs; use dungeon::*; use graphics::*; @@ -76,19 +76,20 @@ impl Game { } } -#[derive(Parser)] +/// Play a dungeon crawl game +#[derive(FromArgs)] struct Args { - /// Enable vsync - #[arg(long)] + /// enable vsync + #[argh(switch)] vsync: bool, - // Enable verbose logging - #[arg(short, long)] + /// enable verbose logging + #[argh(switch, short = 'v')] verbose: bool, } fn main() -> Result<()> { // Parse arguments - let args = Args::parse(); + let args: Args = argh::from_env(); // Load the window let window = WindowBuilder::new() .vsync(args.vsync) -- cgit v1.2.3-freya