From 1c89270d26eaec1e49c01f33426802af68915cd1 Mon Sep 17 00:00:00 2001 From: Kemal Akkoyun Date: Fri, 27 Sep 2024 18:54:55 +0200 Subject: [PATCH] Unify the message formatting Signed-off-by: Kemal Akkoyun --- crates/uv/src/commands/project/run.rs | 9 +++------ crates/uv/tests/run.rs | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index fbe93eb89c75d..e3f5510021d0f 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -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 c3d2efa213f95..ed86973bb16d6 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