Skip to main content

agent_procs/cli/
restart.rs

1use crate::protocol::{Request, Response};
2
3pub async fn execute(session: &str, target: &str) -> i32 {
4    let req = Request::Restart { target: target.into() };
5    match crate::cli::request(session, &req, false).await {
6        Ok(Response::RunOk { name, id, pid }) => { println!("restarted {} (id: {}, pid: {})", name, id, pid); 0 }
7        Ok(Response::Error { code, message }) => { eprintln!("error: {}", message); code }
8        _ => 1,
9    }
10}