Change PluginCommand API to be more like Command #12279
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is something that was discussed in the core team meeting last Wednesday. @ayax79 is building
nu-plugin-polars
with all of the dataframe commands into a plugin, and there are a lot of them, so it would help to make the API more similar. At the same time, I think theCommand
API is just better anyway. I don't think the difference is justified, and the types for core commands have the benefit of requiring less.into()
because they often don't own their datasignature()
up intoname()
,usage()
,extra_usage()
,search_terms()
,examples()
signature()
returnsnu_protocol::Signature
examples()
returnsVec<nu_protocol::Example>
PluginSignature
andPluginExample
no longer need to be used by plugin developersUser-Facing Changes
Breaking API for plugins yet again 馃槃
Tests + Formatting
toolkit fmt
toolkit clippy
toolkit test
toolkit test stdlib
After Submitting