warg_cli/commands/
update.rs

1use super::CommonOptions;
2use anyhow::Result;
3use clap::Args;
4
5/// Update all local package logs.
6#[derive(Args)]
7pub struct UpdateCommand {
8    /// The common command options.
9    #[clap(flatten)]
10    pub common: CommonOptions,
11}
12
13impl UpdateCommand {
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!("updating package logs to the latest available versions...");
20        client.update().await?;
21
22        Ok(())
23    }
24}