1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use super::CommonOptions;
use anyhow::Result;
use clap::Args;

/// Deletes local content cache.
#[derive(Args)]
pub struct ClearCommand {
    /// The common command options.
    #[clap(flatten)]
    pub common: CommonOptions,
}

impl ClearCommand {
    /// Executes the command.
    pub async fn exec(self) -> Result<()> {
        let config = self.common.read_config()?;
        let client = self.common.create_client(&config).await?;

        println!("clearing local content cache...");
        client.clear_content_cache().await?;
        Ok(())
    }
}