warg_cli/commands/
reset.rs

1use super::CommonOptions;
2use anyhow::Result;
3use clap::Args;
4
5/// Reset local data for registry.
6#[derive(Args)]
7pub struct ResetCommand {
8    /// The common command options.
9    #[clap(flatten)]
10    pub common: CommonOptions,
11}
12
13impl ResetCommand {
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!("resetting local registry data...");
20        client.reset_registry().await?;
21        client.reset_namespaces().await?;
22
23        Ok(())
24    }
25}