soroban_cli/commands/cache/
mod.rs

1use clap::Parser;
2
3pub mod actionlog;
4pub mod clean;
5pub mod path;
6
7#[derive(Debug, Parser)]
8pub enum Cmd {
9    /// Delete the cache
10    Clean(clean::Cmd),
11    /// Show the location of the cache
12    Path(path::Cmd),
13    /// Access details about cached actions like transactions, and simulations.
14    /// (Experimental. May see breaking changes at any time.)
15    #[command(subcommand)]
16    Actionlog(actionlog::Cmd),
17}
18
19#[derive(thiserror::Error, Debug)]
20pub enum Error {
21    #[error(transparent)]
22    Clean(#[from] clean::Error),
23    #[error(transparent)]
24    Path(#[from] path::Error),
25    #[error(transparent)]
26    Actionlog(#[from] actionlog::Error),
27}
28
29impl Cmd {
30    pub fn run(&self) -> Result<(), Error> {
31        match self {
32            Cmd::Clean(cmd) => cmd.run()?,
33            Cmd::Path(cmd) => cmd.run()?,
34            Cmd::Actionlog(cmd) => cmd.run()?,
35        }
36        Ok(())
37    }
38}