forest/cli/subcommands/chain_cmd/
prune.rs1use crate::rpc::{self, RpcMethodExt, chain::ChainPruneSnapshot};
5use clap::Subcommand;
6use std::time::Duration;
7
8#[derive(Debug, Subcommand)]
10pub enum ChainPruneCommands {
11 Snap {
13 #[arg(long)]
15 no_wait: bool,
16 },
17}
18
19impl ChainPruneCommands {
20 pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> {
21 match self {
22 Self::Snap { no_wait } => {
23 client
24 .call(ChainPruneSnapshot::request((!no_wait,))?.with_timeout(Duration::MAX))
25 .await?;
26 }
27 }
28
29 Ok(())
30 }
31}