warg_cli/commands/
clear.rs

1use super::CommonOptions;
2use anyhow::Result;
3use clap::Args;
4
5/// Deletes local content cache.
6#[derive(Args)]
7pub struct ClearCommand {
8    /// The common command options.
9    #[clap(flatten)]
10    pub common: CommonOptions,
11}
12
13impl ClearCommand {
14    /// Executes the command.
15    pub async fn exec(self) -> Result<()> {
16        let config = self.common.read_config()?;
17        let client = self.common.create_client(&config).await?;
18
19        println!("clearing local content cache...");
20        client.clear_content_cache().await?;
21        Ok(())
22    }
23}