Added daemon main file with separation of terminal

This commit is contained in:
2026-07-22 00:34:30 +02:00
parent 335c0b0e09
commit 2df381d334
6 changed files with 11 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
use crate::{PulseTradeApp, types::EventLog};
impl PulseTradeApp {
pub async fn execute_command(&mut self, ctx: &pulse_ui::state::Context, command: &str) {
if command.is_empty() {
return;
}
let (command, _args) = if let Some((command, args)) = command.split_once(" ") {
(command, args.split(" ").collect())
} else {
(command, Vec::new())
};
match command {
"exit" | "quit" | "leave" => {
ctx.close().await;
}
_ => {
self.logs.lock().await.push(EventLog {
kind: crate::types::LogKind::Err,
name: "cmd",
message: format!("Command '{}' not found", command),
});
}
}
}
}