use crate::rpc::{self, RpcMethodExt, chain::ChainPruneSnapshot};
use clap::Subcommand;
use std::time::Duration;
#[derive(Debug, Subcommand)]
pub enum ChainPruneCommands {
Snap {
#[arg(long)]
no_wait: bool,
},
}
impl ChainPruneCommands {
pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> {
match self {
Self::Snap { no_wait } => {
client
.call(ChainPruneSnapshot::request((!no_wait,))?.with_timeout(Duration::MAX))
.await?;
}
}
Ok(())
}
}