diff --git a/src/cli.rs b/src/cli.rs index 67376d1..3c2f711 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -86,8 +86,12 @@ pub enum SubCommands { /// A case-insensitive list of names of a mods to remove mod_names: Vec, }, - /// Download and install the latest version of the mods specified - Upgrade, + /// Download and install the latest version of the mods of the selected profile + Upgrade { + /// Instead of only working on the selected profile, work on all profiles + #[clap(long, action=clap::ArgAction::SetTrue)] + all_profiles: bool, + }, } #[derive(Subcommand)] diff --git a/src/main.rs b/src/main.rs index 25a5561..bfa5c1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -355,11 +355,24 @@ async fn actual_main(cli_app: Ferium) -> Result<()> { check_empty_profile(profile)?; subcommands::remove(profile, mod_names)?; }, - SubCommands::Upgrade => { + SubCommands::Upgrade { all_profiles } => { check_internet().await?; - let profile = get_active_profile(&mut config)?; - check_empty_profile(profile)?; - subcommands::upgrade(modrinth, curseforge, github, profile).await?; + if all_profiles { + for profile in &config.profiles { + check_empty_profile(&profile)?; + subcommands::upgrade( + modrinth.clone(), + curseforge.clone(), + github.clone(), + &profile, + ) + .await?; + } + } else { + let profile = get_active_profile(&mut config)?; + check_empty_profile(profile)?; + subcommands::upgrade(modrinth, curseforge, github, profile).await?; + } }, }; diff --git a/src/subcommands/upgrade.rs b/src/subcommands/upgrade.rs index b20c6c2..234021e 100644 --- a/src/subcommands/upgrade.rs +++ b/src/subcommands/upgrade.rs @@ -41,6 +41,11 @@ pub async fn upgrade( let modrinth = Arc::new(modrinth); let github = Arc::new(github); + println!( + "{} Working on profile {}", + "==>".green().bold(), + profile.name.bold() + ); println!("{}\n", "Determining the Latest Compatible Versions".bold()); let semaphore = Arc::new(Semaphore::new(75)); progress_bar