37 lines
721 B
Markdown
37 lines
721 B
Markdown
# Plugin Once
|
|
|
|
Crate with a simple example of the Plugin trait that needs to be implemented
|
|
in order to create a binary that can be registered into nushell declaration list
|
|
|
|
## `once config`
|
|
|
|
This subcommand demonstrates sending configuration from the nushell `$env.config` to a plugin.
|
|
|
|
To make use of the plugin after building `nushell` run:
|
|
|
|
```nushell
|
|
plugin add target/debug/nu_plugin_once
|
|
# or then either restart your current nushell session or run:
|
|
plugin use target/debug/nu_plugin_once
|
|
```
|
|
|
|
The configuration for the plugin lives in `$env.config.plugins.once`:
|
|
|
|
```nushell
|
|
$env.config = {
|
|
plugins: {
|
|
once: [
|
|
some
|
|
values
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
To list plugin values run:
|
|
|
|
```nushell
|
|
once config
|
|
```
|
|
|