From 935ecee9b0c82aa57ec699619ed6da62f4039ca6 Mon Sep 17 00:00:00 2001 From: Julian Hofer Date: Wed, 16 Oct 2024 16:39:52 +0200 Subject: [PATCH] fix: `pixi global upgrade-all` error message Fixes #2293 --- src/cli/global/upgrade.rs | 2 +- src/cli/global/upgrade_all.rs | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/cli/global/upgrade.rs b/src/cli/global/upgrade.rs index 91ed8f31d..c712273f0 100644 --- a/src/cli/global/upgrade.rs +++ b/src/cli/global/upgrade.rs @@ -29,7 +29,7 @@ impl HasSpecs for Args { pub async fn execute(_args: Args) -> miette::Result<()> { Err( - miette::miette!("You can use `pixi global update` for most use cases").wrap_err( + miette::miette!("You can call `pixi global update` for most use cases").wrap_err( "`pixi global upgrade` has been removed, and will be re-added in future releases", ), ) diff --git a/src/cli/global/upgrade_all.rs b/src/cli/global/upgrade_all.rs index bab7c772f..9d7a5fce3 100644 --- a/src/cli/global/upgrade_all.rs +++ b/src/cli/global/upgrade_all.rs @@ -1,34 +1,26 @@ use clap::Parser; +use pixi_config::ConfigCli; use rattler_conda_types::Platform; -use crate::cli::{cli_config::ChannelsConfig, has_specs::HasSpecs}; +use crate::cli::cli_config::ChannelsConfig; -/// Upgrade specific package which is installed globally. +/// Upgrade all globally installed packages #[derive(Parser, Debug)] -#[clap(arg_required_else_help = true)] pub struct Args { - /// Specifies the packages to upgrade. - //#[arg(required = true)] - pub specs: Vec, - #[clap(flatten)] channels: ChannelsConfig, + #[clap(flatten)] + config: ConfigCli, + /// The platform to install the package for. #[clap(long, default_value_t = Platform::current())] platform: Platform, } -impl HasSpecs for Args { - fn packages(&self) -> Vec<&str> { - self.specs.iter().map(AsRef::as_ref).collect() - } -} - pub async fn execute(_args: Args) -> miette::Result<()> { Err( - miette::miette!("You can use `pixi global update` for most use cases").wrap_err( - "`pixi global upgrade-all` has been removed, and will be re-added in future releases", - ), + miette::miette!("You can call `pixi global update` for most use cases") + .wrap_err("`pixi global upgrade-all` has been removed"), ) }