mirror of
https://github.com/nushell/nushell
synced 2025-01-28 04:45:18 +00:00
REFACTOR: fix typos and simplify external std help
(#9100)
followup to #9025 cc/ @YummyOreo # Description this PR simply fixes some typos and simplifies the logic of the external help page opening 😋 # User-Facing Changes ``` $nothing ``` # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - ⚫ `toolkit test` - ⚫ `toolkit test stdlib` # After Submitting ``` $nothing ```
This commit is contained in:
parent
47f9fd3644
commit
a528c043fe
1 changed files with 5 additions and 6 deletions
|
@ -642,11 +642,9 @@ export def "help commands" [
|
||||||
# TODO: impl find for external commands
|
# TODO: impl find for external commands
|
||||||
$commands | find $find --columns [name usage search_terms] | select name category usage signatures search_terms
|
$commands | find $find --columns [name usage search_terms] | select name category usage signatures search_terms
|
||||||
} else if not ($command | is-empty) {
|
} else if not ($command | is-empty) {
|
||||||
let found_commands = ($commands | where name == $command)
|
let found_command = ($commands | where name == $command)
|
||||||
|
|
||||||
if not ($found_commands | is-empty) {
|
if ($found_command | is-empty) {
|
||||||
show-command ($found_commands | get 0)
|
|
||||||
} else {
|
|
||||||
try {
|
try {
|
||||||
print $"(ansi default_italic)Help pages from external command ($command | pretty-cmd):(ansi reset)"
|
print $"(ansi default_italic)Help pages from external command ($command | pretty-cmd):(ansi reset)"
|
||||||
^($env.NU_HELPER? | default "man") $command
|
^($env.NU_HELPER? | default "man") $command
|
||||||
|
@ -655,6 +653,7 @@ export def "help commands" [
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show-command ($found_command | get 0)
|
||||||
} else {
|
} else {
|
||||||
$commands | select name category usage signatures search_terms
|
$commands | select name category usage signatures search_terms
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue