Config reload command

This commit is contained in:
2026-07-24 18:02:26 +02:00
parent ef5f88516a
commit c84b26b2ec
+21 -1
View File
@@ -65,8 +65,28 @@ impl Engine {
} }
} }
pub async fn execute_command(&self, command: &str, _args: Vec<&str>) -> tokio::io::Result<()> { pub async fn execute_command(&self, command: &str, args: Vec<&str>) -> tokio::io::Result<()> {
match command { match command {
"config" => {
const MESSAGE: &str = "Invalid command arguments, usage: config <reload>";
if args.len() != 1 {
self.terminal_server.error("config", MESSAGE).await?;
return Ok(());
}
match args[0] {
"reload" => {
*self.config.lock().await = Config::new().await?;
}
_ => {
self.terminal_server.error("config", MESSAGE).await?;
}
}
}
_ => { _ => {
self.terminal_server self.terminal_server
.error( .error(