summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
Diffstat (limited to 'game')
-rw-r--r--game/Cargo.toml2
-rw-r--r--game/src/main.rs15
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)