mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
parent
c0875fd8fe
commit
1c6c8db1a2
3 changed files with 11 additions and 4 deletions
|
@ -1902,9 +1902,16 @@ pub struct ToolNamespace {
|
|||
|
||||
#[derive(Subcommand)]
|
||||
pub enum ToolCommand {
|
||||
/// Run a tool
|
||||
/// Run a tool.
|
||||
Run(ToolRunArgs),
|
||||
/// Install a tool
|
||||
/// Hidden alias for `uv tool run` for invocation from the `uvx` command
|
||||
#[command(
|
||||
hide = true,
|
||||
override_usage = "uvx [OPTIONS] <COMMAND>",
|
||||
about = "Run a tool."
|
||||
)]
|
||||
Uvx(ToolRunArgs),
|
||||
/// Install a tool.
|
||||
Install(ToolInstallArgs),
|
||||
/// List installed tools.
|
||||
List(ToolListArgs),
|
||||
|
|
|
@ -11,7 +11,7 @@ fn run() -> Result<ExitStatus, anyhow::Error> {
|
|||
bail!("Could not determine the location of the `uvx` binary")
|
||||
};
|
||||
let uv = bin.join("uv");
|
||||
let args = ["tool", "run"]
|
||||
let args = ["tool", "uvx"]
|
||||
.iter()
|
||||
.map(OsString::from)
|
||||
// Skip the `uvx` name
|
||||
|
|
|
@ -785,7 +785,7 @@ async fn run() -> Result<ExitStatus> {
|
|||
Ok(ExitStatus::Success)
|
||||
}
|
||||
Commands::Tool(ToolNamespace {
|
||||
command: ToolCommand::Run(args),
|
||||
command: ToolCommand::Run(args) | ToolCommand::Uvx(args),
|
||||
}) => {
|
||||
// Resolve the settings from the command-line arguments and workspace configuration.
|
||||
let args = settings::ToolRunSettings::resolve(args, filesystem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue