Skip to content

Commit

Permalink
new: Merge proto install and proto use. (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jul 26, 2024
1 parent f919dc3 commit 68d1cc9
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 200 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
- [Rust](https://github.com/moonrepo/rust-plugin/blob/master/CHANGELOG.md)
- [TOML schema](https://github.com/moonrepo/schema-plugin/blob/master/CHANGELOG.md)

## Unreleased

#### 🚀 Updates

- Merged `proto use` and `proto install` commands. If no arguments are provided to `proto install`, it will install all configured tools.

## 0.38.4

#### 🐞 Fixes
Expand Down
14 changes: 3 additions & 11 deletions crates/cli/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::commands::{
debug::DebugConfigArgs,
install_all::InstallAllArgs,
plugin::{AddPluginArgs, InfoPluginArgs, ListPluginsArgs, RemovePluginArgs, SearchPluginArgs},
ActivateArgs, AliasArgs, BinArgs, CleanArgs, CompletionsArgs, DiagnoseArgs, InstallArgs,
ListArgs, ListRemoteArgs, MigrateArgs, OutdatedArgs, PinArgs, RegenArgs, RunArgs, SetupArgs,
Expand Down Expand Up @@ -160,10 +159,10 @@ pub enum Commands {
Diagnose(DiagnoseArgs),

#[command(
alias = "i",
aliases = ["i", "u", "use"],
name = "install",
about = "Download and install a tool.",
long_about = "Download and install a tool by version into ~/.proto/tools."
about = "Download and install one or many tools.",
long_about = "Download and install one or many tools by version into ~/.proto/tools.\n\nIf no arguments are provided, will install all tools configured in .prototools.\n\nIf a name argument is provided, will install a single tool by version."
)]
Install(InstallArgs),

Expand Down Expand Up @@ -260,13 +259,6 @@ pub enum Commands {
about = "Upgrade proto to the latest version."
)]
Upgrade,

#[command(
alias = "u",
name = "use",
about = "Download and install all tools from loaded .prototools."
)]
Use(InstallAllArgs),
}

#[derive(Clone, Debug, Subcommand)]
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ pub async fn purge_plugins(session: &ProtoSession, yes: bool) -> AppResult {
Ok(())
}

pub async fn internal_clean(session: &ProtoSession, args: &CleanArgs, yes: bool) -> AppResult {
pub async fn internal_clean(session: &ProtoSession, args: CleanArgs, yes: bool) -> AppResult {
let days = args.days.unwrap_or(30);
let now = SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
Expand Down Expand Up @@ -334,7 +334,7 @@ pub async fn clean(session: ProtoSession, args: CleanArgs) -> AppResult {
return Ok(());
}

internal_clean(&session, &args, force_yes).await?;
internal_clean(&session, args, force_yes).await?;

Ok(())
}
Loading

0 comments on commit 68d1cc9

Please sign in to comment.