Skip to content

Commit

Permalink
Add dedicated help menu for uvx (#4770)
Browse files Browse the repository at this point in the history
Closes #4749
  • Loading branch information
zanieb committed Jul 3, 2024
1 parent c0875fd commit 1c6c8db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/bin/uvx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c6c8db

Please sign in to comment.