From ce071f249845a6e11eb764d311d86a20a5a94815 Mon Sep 17 00:00:00 2001 From: Bob Hyman Date: Wed, 17 May 2023 14:02:23 -0400 Subject: [PATCH] fix spurious 'item not found' error in `std help` (#9197) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ses). # Description See title. Fixes #9154 (despite name of branch) # User-Facing Changes n/a # Tests + Formatting # After Submitting --- crates/nu-std/lib/help.nu | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/nu-std/lib/help.nu b/crates/nu-std/lib/help.nu index 82b56b8259..5cec601ec3 100644 --- a/crates/nu-std/lib/help.nu +++ b/crates/nu-std/lib/help.nu @@ -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 }