Crates.io | bevy_clap |
lib.rs | bevy_clap |
version | 0.1.0 |
source | src |
created_at | 2022-02-08 00:13:03.005849 |
updated_at | 2022-02-08 00:13:03.005849 |
description | A bevy plugin to parse CLI arguments with clap |
homepage | |
repository | https://github.com/Diggsey/bevy_clap |
max_upload_size | |
id | 528734 |
size | 5,160 |
A bevy plugin to parse command line arguments with clap.
#[derive(clap::Parser)]
#[clap(name = "demo")]
struct Context {
/// More verbose output
#[clap(long)]
verbose: bool,
/// An optional name
#[clap(short, long)]
name: Option<String>,
}
fn main() {
App::new()
// ...
.add_plugin(ClapPlugin::<Context>::default())
// ...
.run();
}
The Context
value will be added as a clap resource on startup.