fix spurious 'item not found' error in std help (#9197)

…ses).


# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
See title.  
Fixes #9154 
(despite name of branch)

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
n/a
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> [x] toolkit check pr
> ```
-->

# 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:
Bob Hyman 2023-05-17 14:02:23 -04:00 committed by GitHub
parent 057de06613
commit ce071f2498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,8 +138,8 @@ def show-module [module: record] {
}
if not ($module.aliases? | is-empty) {
print-help-header -n "Exported aliases:"
print $module.aliases
print-help-header "Exported aliases"
print $" ($module.aliases | str join ', ')"
print ""
}
@ -147,7 +147,7 @@ def show-module [module: record] {
print $"This module (ansi cyan)does not export(ansi reset) environment."
} else {
print $"This module (ansi cyan)exports(ansi reset) environment."
view source $module.env_block
print (view source $module.env_block)
}
}
@ -253,6 +253,7 @@ export def "help modules" [
}
show-module ($found_module | get 0)
" " # signal something was shown
} else {
$modules
}
@ -355,6 +356,7 @@ export def "help aliases" [
}
show-alias ($found_alias | get 0)
" " # signal something was shown
} else {
$aliases
}
@ -393,6 +395,7 @@ export def "help externs" [
}
show-extern ($found_extern | get 0)
" " # signal something was shown
} else {
$externs
}
@ -457,6 +460,7 @@ export def "help operators" [
}
show-operator ($found_operator | get 0)
" " # signal something was shown
} else {
$operators
}
@ -666,6 +670,7 @@ export def "help commands" [
}
show-command ($found_command | get 0)
" " # signal something was shown
} else {
$commands | select name category usage signatures search_terms
}