Skip to main content

ReplCommand

Derive Macro ReplCommand 

Source
#[derive(ReplCommand)]
Expand description

Derive macro that automatically implements ReplCommand for structs that use clap’s Parser derive.

§Example

use bevy::prelude::*;
use bevy_repl::prelude::*;
use clap::Parser;

#[derive(Parser, ReplCommand, Debug, Clone, Event, Default)]
#[command(name = "say", about = "Say something")]
struct SayCommand {
    #[arg(help = "Message to say")]
    message: String,
}