forest/cli/subcommands/
shutdown_cmd.rs1use crate::cli::subcommands::prompt_confirm;
5use crate::rpc::{self, prelude::*};
6
7#[derive(Debug, clap::Args)]
8pub struct ShutdownCommand {
9 #[arg(long)]
11 force: bool,
12}
13
14impl ShutdownCommand {
15 pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> {
16 println!("Shutting down Forest node");
17 if !self.force && !prompt_confirm() {
18 println!("Aborted.");
19 return Ok(());
20 }
21 Shutdown::call(&client, ()).await?;
22 Ok(())
23 }
24}