diff --git a/cli/tools/registry/pm/outdated.rs b/cli/tools/registry/pm/outdated.rs index 2a29014267..073d772f8a 100644 --- a/cli/tools/registry/pm/outdated.rs +++ b/cli/tools/registry/pm/outdated.rs @@ -100,6 +100,24 @@ 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!(); + let (cmd, txt) = if compatible { + ("", "compatible") + } else { + (" --latest", "available") + }; + println!( + "{}", + color_print::cformat!( + "
Run> deno outdated --update{}>
to update to the latest {} versions,>\n
or> deno outdated --help>
for more information.>", + cmd, + txt, + ) + ); +} + fn print_outdated( deps: &mut DepManager, compatible: bool, @@ -148,6 +166,7 @@ fn print_outdated( if !outdated.is_empty() { outdated.sort(); print_outdated_table(&outdated); + print_suggestion(compatible); } Ok(()) diff --git a/tests/specs/update/deno_json/outdated.out b/tests/specs/update/deno_json/outdated.out index 07ff9f3416..dd86ed8e87 100644 --- a/tests/specs/update/deno_json/outdated.out +++ b/tests/specs/update/deno_json/outdated.out @@ -13,3 +13,6 @@ ├────────────────────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ └────────────────────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update --latest to update to the latest available versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/deno_json/outdated_compatible.out b/tests/specs/update/deno_json/outdated_compatible.out index 54511a537f..8b67e0750e 100644 --- a/tests/specs/update/deno_json/outdated_compatible.out +++ b/tests/specs/update/deno_json/outdated_compatible.out @@ -5,3 +5,6 @@ ├──────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ └──────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update to update to the latest compatible versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/mixed_workspace/print_outdated/member_a.out b/tests/specs/update/mixed_workspace/print_outdated/member_a.out index 8699aac2bf..9abfd127c0 100644 --- a/tests/specs/update/mixed_workspace/print_outdated/member_a.out +++ b/tests/specs/update/mixed_workspace/print_outdated/member_a.out @@ -7,3 +7,6 @@ ├────────────────────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ └────────────────────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update --latest to update to the latest available versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/mixed_workspace/print_outdated/member_b.out b/tests/specs/update/mixed_workspace/print_outdated/member_b.out index fc8ef320a8..80548e4ac3 100644 --- a/tests/specs/update/mixed_workspace/print_outdated/member_b.out +++ b/tests/specs/update/mixed_workspace/print_outdated/member_b.out @@ -5,3 +5,6 @@ ├──────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │ └──────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update --latest to update to the latest available versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/mixed_workspace/print_outdated/recursive.out b/tests/specs/update/mixed_workspace/print_outdated/recursive.out index ca03776a9c..1c4f4d06e2 100644 --- a/tests/specs/update/mixed_workspace/print_outdated/recursive.out +++ b/tests/specs/update/mixed_workspace/print_outdated/recursive.out @@ -13,3 +13,6 @@ ├────────────────────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ └────────────────────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update --latest to update to the latest available versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/mixed_workspace/print_outdated/root.out b/tests/specs/update/mixed_workspace/print_outdated/root.out index c7934edc79..ef8df6dbe1 100644 --- a/tests/specs/update/mixed_workspace/print_outdated/root.out +++ b/tests/specs/update/mixed_workspace/print_outdated/root.out @@ -3,3 +3,6 @@ ├────────────────────────┼─────────┼────────┼────────┤ │ jsr:@denotest/subtract │ 0.2.0 │ 0.2.0 │ 1.0.0 │ └────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update --latest to update to the latest available versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/package_json/outdated.out b/tests/specs/update/package_json/outdated.out index d672aace7f..cf61af8065 100644 --- a/tests/specs/update/package_json/outdated.out +++ b/tests/specs/update/package_json/outdated.out @@ -7,3 +7,6 @@ ├────────────────────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ └────────────────────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update --latest to update to the latest available versions, +or deno outdated --help for more information. diff --git a/tests/specs/update/package_json/outdated_compatible.out b/tests/specs/update/package_json/outdated_compatible.out index 8a682c461c..812e9ba0f4 100644 --- a/tests/specs/update/package_json/outdated_compatible.out +++ b/tests/specs/update/package_json/outdated_compatible.out @@ -3,3 +3,6 @@ ├──────────────────────────────────┼─────────┼────────┼────────┤ │ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ └──────────────────────────────────┴─────────┴────────┴────────┘ + +Run deno outdated --update to update to the latest compatible versions, +or deno outdated --help for more information.