From 3a6d8aac0bce6a70351fcfe860e0aa3694054a99 Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Sat, 15 Jun 2024 13:27:55 -0400 Subject: [PATCH] Return an empty list when no `std help --find` results are found (#13160) # Description Fixes #13143 by returning an empty list when there are no results found by `std help --find/-f` # User-Facing Changes In addition, prints a message to stderr. # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :green_circle: `toolkit test` - :green_circle: `toolkit test stdlib` # After Submitting --- crates/nu-std/std/help.nu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/nu-std/std/help.nu b/crates/nu-std/std/help.nu index 614ec402d11..16a20504cb5 100644 --- a/crates/nu-std/std/help.nu +++ b/crates/nu-std/std/help.nu @@ -771,6 +771,11 @@ You can also learn more at (ansi default_italic)(ansi light_cyan_underline)https let modules = (try { modules $target_item --find $find }) if not ($modules | is-empty) { return $modules } + + if ($find | is-not-empty) { + print -e $"No help results found mentioning: ($find)" + return [] + } let span = (metadata $item | get span) error make {