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 {
5 target: target.into(),
6 };
7 crate::cli::request_and_handle(session, &req, false, |resp| match resp {
8 Response::RunOk { name, id, pid, .. } => {
9 println!("restarted {} (id: {}, pid: {})", name, id, pid);
10 Some(0)
11 }
12 _ => None,
13 })
14 .await
15}