Skip to content

Commit

Permalink
added: better explanations of version string for help command in the …
Browse files Browse the repository at this point in the history
…failed version on installed command
  • Loading branch information
MordechaiHadad committed Nov 5, 2024
1 parent c28cf0c commit cb01a64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ enum Cli {
/// install command if the version is not installed already
Use {
/// Version to switch to |nightly|stable|<version-string>|<commit-hash>|
///
/// A version-string can either be `vx.x.x` or `x.x.x` examples: `v0.6.1` and `0.6.0`
version: String,

/// Whether not to auto-invoke install command
Expand All @@ -68,6 +70,8 @@ enum Cli {
/// out-of-date nightly version
Install {
/// Version to be installed |nightly|stable|<version-string>|<commit-hash>|
///
/// A version-string can either be `vx.x.x` or `x.x.x` examples: `v0.6.1` and `0.6.0`
version: String,
},

Expand All @@ -79,6 +83,9 @@ enum Cli {
#[clap(alias = "remove", visible_alias = "rm")]
Uninstall {
/// Optional Version to be uninstalled |nightly|stable|<version-string>|<commit-hash>|
///
/// A version-string can either be `vx.x.x` or `x.x.x` examples: `v0.6.1` and `0.6.0`
///
/// If no Version is provided a prompt is used to select the versions to be uninstalled
version: Option<String>,
},
Expand Down
8 changes: 7 additions & 1 deletion src/helpers/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ pub async fn parse_version_type(client: &Client, version: &str) -> Result<Parsed
});
}

Err(anyhow!("Please provide a proper version string"))
Err(anyhow!(
"Please provide a proper version string. Valid options are:
• stable|latest|nightly - Latest stable, most recent, or nightly build
• [v]x.x.x - Specific version (e.g., 0.6.0 or v0.6.0)
• <commit-hash> - Specific commit hash"
))
}
}
}
Expand Down

0 comments on commit cb01a64

Please sign in to comment.