Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Convert help example results to text #12078

Merged
merged 2 commits into from Mar 7, 2024

Conversation

NotTheDr01ds
Copy link
Contributor

Description

Converts help example results to text in build-command-page. This prevents an item_not_found error when attempting to help <command> on many legitimate commands.

Fixes #12073

User-Facing Changes

Tests + Formatting

After Submitting

@fdncred
Copy link
Collaborator

fdncred commented Mar 5, 2024

Seems to be working now. Thanks!

Separately, we need to figure out how to make the std help respect the theme coloring. I noticed help loop has different colors than help loop after using std help.

@NotTheDr01ds
Copy link
Contributor Author

NotTheDr01ds commented Mar 5, 2024

Separately, we need to figure out how to make the std help respect the theme coloring. I noticed help loop has different colors than help loop after using std help.

Odd - I'm not able to reproduce that. I'm using the ashes theme and both help loop and std help loop are honoring the theme.

std help is just running the examples through nu-highlight, at least on the happy path I tested, and nu-highlightalso seems to be honoring the theme for me.

If you can provide any more info on how to reproduce (maybe open an issue), I'll be happy to take a look. I may not be able to handle Rust changes (yet), but I can certainly take a stab at std stuff ;-).

@fdncred
Copy link
Collaborator

fdncred commented Mar 5, 2024

Here's what I see. Notice the Flags: and Parameters: are different colors.

Built In Help

image

Script Help

image

@NotTheDr01ds
Copy link
Contributor Author

NotTheDr01ds commented Mar 6, 2024

@fdncred Ah, got it - So the "Examples" is matching the theme, but the rest of the help isn't.

I'll try to take a look, but that will probably also involve needing to figure out how the internal help implementation does it.

@fdncred
Copy link
Collaborator

fdncred commented Mar 6, 2024

ideally, i think both helps should look identically. maybe others disagree?

@fdncred
Copy link
Collaborator

fdncred commented Mar 7, 2024

Let's land this one and put the coloring one in another PR. Thanks!

@fdncred fdncred merged commit 87fa86c into nushell:main Mar 7, 2024
19 checks passed
@kubouch kubouch added this to the v0.92.0 milestone Mar 7, 2024
@kubouch kubouch added the pr:bugfix This PR fixes some bug label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix This PR fixes some bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

help in standard library errors on some commands
3 participants