diff --git a/tools/playground/Cargo.toml b/tools/playground/Cargo.toml index 42ec02d..c1c5c5d 100644 --- a/tools/playground/Cargo.toml +++ b/tools/playground/Cargo.toml @@ -5,6 +5,7 @@ edition.workspace = true [dependencies] anyhow = "1.0.65" +clap = { version = "4", features = ["derive"] } glam = "0.23.0" tracing = "0.1.37" tracing-subscriber = "0.3.16" diff --git a/tools/playground/src/main.rs b/tools/playground/src/main.rs index b1498cb..6d9a94f 100644 --- a/tools/playground/src/main.rs +++ b/tools/playground/src/main.rs @@ -16,6 +16,7 @@ clippy::dbg_macro )] +use clap::Parser; use tracing::Level; use valence::app::App; @@ -23,9 +24,17 @@ use valence::app::App; mod extras; mod playground; +#[derive(Parser)] +struct Args { + #[arg(short, default_value_t = Level::DEBUG)] + log_level: Level, +} + fn main() { + let args = Args::parse(); + tracing_subscriber::fmt() - .with_max_level(Level::DEBUG) + .with_max_level(args.log_level) .init(); let mut app = App::new();