This commit is contained in:
Andy Gayton 2024-07-04 23:46:43 -04:00
parent b98eee9bd0
commit c639432091
8 changed files with 11 additions and 20 deletions

View File

@ -5275,15 +5275,6 @@ pub fn parse_expression(working_set: &mut StateWorkingSet, spans: &[Span]) -> Ex
}
b"where" => parse_where_expr(working_set, &spans[pos..]),
#[cfg(feature = "plugin")]
b"register" => {
working_set.error(ParseError::BuiltinCommandInPipeline(
"register".into(),
spans[0],
));
parse_call(working_set, &spans[pos..], spans[0])
}
#[cfg(feature = "plugin")]
b"plugin" => {
if spans.len() > 1 && working_set.get_span_contents(spans[1]) == b"use" {
// only 'plugin use' is banned

View File

@ -340,7 +340,7 @@ where
/// Build a [`PluginSignature`] from the signature-related methods on [`PluginCommand`].
///
/// This is sent to the engine on `register`.
/// This is sent to the engine on `plugin add`.
///
/// This is not a public API.
#[doc(hidden)]

View File

@ -38,7 +38,7 @@ pub(crate) const OUTPUT_BUFFER_SIZE: usize = 16384;
/// The API for a Nushell plugin
///
/// A plugin defines multiple commands, which are added to the engine when the user calls
/// `register`.
/// `plugin add`.
///
/// The plugin must be able to be safely shared between threads, so that multiple invocations can
/// be run in parallel. If interior mutability is desired, consider synchronization primitives such

View File

@ -26,7 +26,7 @@ pub trait RegisteredPlugin: Send + Sync {
fn stop(&self) -> Result<(), ShellError>;
/// Stop the plugin and reset any state so that we don't make any assumptions about the plugin
/// next time it launches. This is used on `register`.
/// next time it launches. This is used on `plugin add`.
fn reset(&self) -> Result<(), ShellError>;
/// Cast the pointer to an [`Any`] so that its concrete type can be retrieved.

View File

@ -12,7 +12,7 @@ A nushell plugin to convert data to nushell tables.
# Usage
1. compile the binary: `cargo build`
2. register plugin(assume it's compiled in ./target/debug/):
2. plugin add plugin(assume it's compiled in ./target/debug/):
```
register ./target/debug/nu_plugin_formats
plugin add ./target/debug/nu_plugin_formats
```

View File

@ -8,6 +8,6 @@ To install:
> cargo install --path .
```
To register (from inside Nushell):
To add the plugin (from inside Nushell):
```
> register <path to installed plugin>
> plugin add <path to installed plugin>

View File

@ -8,6 +8,6 @@ To install:
cargo install --path .
```
To register (from inside Nushell):
To add the plugin (from inside Nushell):
```
register <path to installed plugin>
> plugin add <path to installed plugin>

View File

@ -7,7 +7,7 @@
# decode and encode information that is read and written to stdin and stdout
#
# To register the plugin use:
# register <path-to-py-file>
# plugin add <path-to-py-file>
#
# Be careful with the spans. Miette will crash if a span is outside the
# size of the contents vector. We strongly suggest using the span found in the