1 个不稳定版本
0.1.0 | 2022年2月8日 |
---|
#1256 in 游戏开发
4KB
bevy_clap
一个用于使用 clap 解析命令行参数的 bevy 插件。
用法
#[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();
}
在启动时,将 Context
值添加为 clap 资源。
lib.rs
:
bevy_clap
依赖关系
~19–35MB
~560K SLoC