Skip to content

fix multiple search items help message - #18482

Merged
fdncred merged 3 commits into
nushell:mainfrom
pheenty:fix/duplicatetest
Jun 27, 2026
Merged

fdncred merged 3 commits into
nushell:mainfrom
pheenty:fix/duplicatetest

Conversation

@pheenty

@pheenty pheenty commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adresses two issues.
First, there was a bad test no_search_term_duplicates which despite its name merely checked whether search terms for all commands are not contained in the name of their own commands. Which meant that for whatever reason redirecting people who want to use sqrt to math sqrt would violate tests.
The test would make sense (before the second change in the PR) if it actually did what it's supposed to, but it didn't do even that, so I've opted to just remove it.
Oh, also yes, I've added sqrt as math sqrt search term.

To avoid further confusion, I've renamed the test to no_command_name_contains_search_terms

Second, help messages for search terms would only show the first command that satisfies. For example, try typing root into the shell. You will see this:

❯ root
Error: nu::shell::external_command

  × External command failed
   ╭─[repl_entry #1:1:1]
 1 │ root
   · ──┬─
   ·   ╰── Command `root` not found
   ╰────
  help: Did you mean `is-admin`?

And this is despite "math sqrt" also having "root" as its search terms. I've made it so all commands show up:

Error: nu::shell::external_command

  × External command failed
   ╭─[source:1:1]
 1 │ root
   · ──┬─
   ·   ╰── Command `root` not found
   ╰────
  help: Did you mean `is-admin` or `math sqrt`?

User-facing changes (Release notes)

n/a really

Additional notes

@fdncred

fdncred commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

We don't want to allow sqrt to be used as a search term for commands like math sqrt because the intent of search terms is to find commands with help -f term, and the command name is already searched. It sounds like you've changed that so please put that back in place.

I'm fine with things like root showing math sqrt since it's in the search terms.

@pheenty

pheenty commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Okay, I'll bring the test back and rename it then

@fdncred
fdncred merged commit cddc963 into nushell:main Jun 27, 2026
17 checks passed
@fdncred

fdncred commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Thanks

@github-actions github-actions Bot added this to the v0.114.0 milestone Jun 27, 2026
fdncred pushed a commit that referenced this pull request Jun 27, 2026
<!--
Thanks for contributing to Nushell!

Before submitting, please read the contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md

This template helps reviewers understand your changes and allows us to
generate high-quality release notes.
-->

## Description
<!--
Explain what this PR does and why.

This section is intentionally flexible:
- Describe the problem
- Explain your approach
- Include technical details if relevant

Good examples:
- "In this PR, I fixed..."
- "In this PR, I added support for..."
- "This change improves X by..."

Write as much or as little as needed for reviewers to understand your
changes.
-->

literally the title.

## User-facing changes (Release notes)
<!--
This section is used (mostly as-is) for https://www.nushell.sh/blog/

Describe how Nushell behavior changes from a user's perspective.
Do NOT describe internal Rust changes here.

Write in a release note style, for example:
- "Added support for..."
- "Fixed an issue where..."
- "Nushell now supports..."
- "Improved performance of..."

If your changes do NOT affect users (internal refactors, cleanup, etc.),
just write:
- "n/a"
- "nan"
- or similar

This tells us the change should not appear in the changelog.

Tips:
- Focus on observable behavior
- Include examples if helpful
- Keep it concise

You can:
- Write a short paragraph (will appear as a bullet point), OR
- Use headings (###) if your change needs more structure

Avoid writing things like:
- "In this PR, I refactored..."
- "This updates internal code..."

You may leave this blank until the PR is ready.
-->

Added `math cbrt` (cube root) function.

<!--
## Additional notes
Requires #18482 (well, not really, but will fail tests otherwise)
Optional.

Examples:
- fixes #123
- closes #456
- related #789

Anything else reviewers should know.
Remove this section if not needed.
-->
@fdncred fdncred added the notes:fixes Noted in "Bug fixes" section label Jun 27, 2026
@pheenty
pheenty deleted the fix/duplicatetest branch June 27, 2026 15:31
@cptpiepmatz cptpiepmatz added notes:mention Noted in "Hall of Fame" section notes:ready Indicates Ready for Release notes and removed notes:fixes Noted in "Bug fixes" section labels Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:mention Noted in "Hall of Fame" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants