Add support for specifying name@version in uv tool run (#4572)

Instead of requiring `uv tool run --from package==version command` we
support `uv tool run command@version` shorthand.
This commit is contained in:
Zanie Blue 2024-06-27 06:50:15 -04:00 committed by GitHub
parent 857b3cc777
commit cb580d1a5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 144 additions and 8 deletions

View file

@ -1861,6 +1861,13 @@ pub enum ToolCommand {
#[allow(clippy::struct_excessive_bools)]
pub struct ToolRunArgs {
/// The command to run.
///
/// By default, the package to install is assumed to match the command name.
///
/// The name of the command can include an exact version in the format `<package>@<version>`.
///
/// If more complex version specification is desired or if the command is provided by a different
/// package, use `--from`.
#[command(subcommand)]
pub command: ExternalCommand,