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

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
This commit is contained in:
NotTheDr01ds 2024-06-15 13:27:55 -04:00 committed by GitHub
parent b1cf0e258d
commit 3a6d8aac0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {