mirror of
https://codeberg.org/schrottkatze/mgd2-tram-championships.git
synced 2025-07-04 11:07:40 +00:00
refactor console to take DebugEvent
s directly
This commit is contained in:
parent
cf05050c95
commit
3157af2c2b
3 changed files with 11 additions and 14 deletions
|
@ -12,21 +12,12 @@ pub(super) fn respond(line: &str) -> Result<DebugEvent, String> {
|
|||
return Ok(DebugEvent::PrintToConsole(s));
|
||||
}
|
||||
|
||||
Ok(match cli?.cmd {
|
||||
Commands::Close => DebugEvent::CloseDebugConsole,
|
||||
Commands::Echo { text } => DebugEvent::PrintToConsole(text),
|
||||
})
|
||||
Ok(cli?.cmd)
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(multicall = true)]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
cmd: Commands,
|
||||
}
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
enum Commands {
|
||||
Close,
|
||||
Echo { text: String },
|
||||
cmd: DebugEvent,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue