1 unstable release

0.1.0 Feb 8, 2022

#23 in #clap-parser

33 downloads per month

MIT/Apache

4KB

bevy_clap

A bevy plugin to parse command line arguments with clap.

Usage

#[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.


lib.rs:

bevy_clap

Dependencies

~18–27MB
~490K SLoC