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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for getting help text from a plugin command #12243

Merged
merged 1 commit into from Mar 23, 2024

Conversation

devyn
Copy link
Contributor

@devyn devyn commented Mar 19, 2024

Description

There wasn't really a good way to implement a command group style (e.g. from, query, etc.) command in the past that just returns the help text even if --help is not passed. This adds a new engine call that just does that.

This is actually something I ran into before when developing the dbus plugin, so it's nice to fix it.

User-Facing Changes

Tests + Formatting

  • 馃煝 toolkit fmt
  • 馃煝 toolkit clippy
  • 馃煝 toolkit test
  • 馃煝 toolkit test stdlib

After Submitting

  • Document GetHelp engine call in proto

@WindSoilder
Copy link
Collaborator

Since #12248 is merged, you can apply the new logic here :)

@fdncred fdncred added pr:api-change This PR should be mentioned in #api-updates channel on Discord pr:plugins This PR is related to plugins labels Mar 21, 2024
@fdncred
Copy link
Collaborator

fdncred commented Mar 23, 2024

if we can fix the conflicts, we can land this.

@devyn
Copy link
Contributor Author

devyn commented Mar 23, 2024

I'll fix it up tonight

@abusch
Copy link
Contributor

abusch commented Mar 23, 2024

Oh, nice! I ran into that with nu_plugin_semver too.

There wasn't really a good way to implement a command group style (e.g.
`from`, `query`, etc.) command in the past that just returns the help
text even if `--help` is not passed. This adds a new engine call that
just does that.
@devyn
Copy link
Contributor Author

devyn commented Mar 23, 2024

Fixed!

Copy link
Collaborator

@WindSoilder WindSoilder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@WindSoilder WindSoilder merged commit 78be67f into nushell:main Mar 23, 2024
16 checks passed
@hustcer hustcer added this to the v0.92.0 milestone Mar 24, 2024
@devyn devyn deleted the plugin-get_help branch March 24, 2024 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:api-change This PR should be mentioned in #api-updates channel on Discord pr:plugins This PR is related to plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants