diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-10 19:14:50 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-10 19:15:02 -0500 |
| commit | 0f76cc3d9078b18e509dc88899daf23102019335 (patch) | |
| tree | 57996b434f191d83ed6637570fef7134205e9164 /game | |
| parent | Checkpoint writeup started (diff) | |
| download | DungeonCrawl-0f76cc3d9078b18e509dc88899daf23102019335.tar.gz DungeonCrawl-0f76cc3d9078b18e509dc88899daf23102019335.tar.bz2 DungeonCrawl-0f76cc3d9078b18e509dc88899daf23102019335.zip | |
minimize dependencies & features
Diffstat (limited to 'game')
| -rw-r--r-- | game/Cargo.toml | 2 | ||||
| -rw-r--r-- | game/src/main.rs | 15 |
2 files changed, 9 insertions, 8 deletions
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) |