diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index fbe93eb89c75..57b6d44d0256 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -734,13 +734,13 @@ pub(crate) async fn run( .ok() .into_iter() .flatten() - .filter_map(|entry| match entry { - Ok(entry) => Some(Ok(entry)), + .map(|entry| match entry { + Ok(entry) => Ok(entry), Err(err) => { // If we can't read the entry, fail. // This could be a symptom of a more serious problem. warn!("Failed to read entry: {}", err); - Some(Err(err)) + Err(err) } }) .collect::, _>>()? @@ -773,16 +773,13 @@ pub(crate) async fn run( .collect_vec(); if !commands.is_empty() { - writeln!(printer.stdout(), "The following commands are available:")?; + writeln!(printer.stdout(), "The following commands are available:\n")?; for command in commands { writeln!(printer.stdout(), "- {command}")?; } } - writeln!( - printer.stdout(), - "\nSee `uv run --help` for more information." - )?; - + let help = format!("See `{}` for more information.", "uv run --help".bold()); + writeln!(printer.stdout(), "\n{help}")?; return Ok(ExitStatus::Error); }; diff --git a/crates/uv/tests/run.rs b/crates/uv/tests/run.rs index c3d2efa213f9..ed86973bb16d 100644 --- a/crates/uv/tests/run.rs +++ b/crates/uv/tests/run.rs @@ -226,6 +226,7 @@ fn run_no_args() -> Result<()> { Provide a command or script to invoke with `uv run ` or `uv run