diff --git a/cli/tools/registry/pm/outdated.rs b/cli/tools/registry/pm/outdated.rs index 073d772f8a..9389f59678 100644 --- a/cli/tools/registry/pm/outdated.rs +++ b/cli/tools/registry/pm/outdated.rs @@ -100,15 +100,14 @@ fn print_outdated_table(packages: &[OutdatedPackage]) { println!("└{package_fill}┴{current_fill}┴{update_fill}┴{latest_fill}┘",); } -#[allow(clippy::print_stdout)] fn print_suggestion(compatible: bool) { - println!(); + log::info!(""); let (cmd, txt) = if compatible { ("", "compatible") } else { (" --latest", "available") }; - println!( + log::info!( "{}", color_print::cformat!( "Run deno outdated --update{} to update to the latest {} versions,\nor deno outdated --help for more information.", diff --git a/tests/specs/update/deno_json/__test__.jsonc b/tests/specs/update/deno_json/__test__.jsonc index 8b4aa26b5c..c57115fb02 100644 --- a/tests/specs/update/deno_json/__test__.jsonc +++ b/tests/specs/update/deno_json/__test__.jsonc @@ -26,6 +26,11 @@ { "args": "outdated", "output": "outdated.out" + }, + { + // Respect `--quiet flag and don't print hint how to update + "args": "outdated --quiet", + "output": "outdated_quiet.out" } ] }, diff --git a/tests/specs/update/deno_json/outdated_quiet.out b/tests/specs/update/deno_json/outdated_quiet.out new file mode 100644 index 0000000000..07ff9f3416 --- /dev/null +++ b/tests/specs/update/deno_json/outdated_quiet.out @@ -0,0 +1,15 @@ +┌────────────────────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/multiple-exports │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/subtract │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/add │ 0.2.0 │ 0.2.1 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ +└────────────────────────────────────────────────┴─────────┴────────┴────────┘