You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fixup `usage`->`description` in plugin stuff
Forgot to follow up nushell/nushell#13598 here.
Supersede that part of closed#1724
* Fix table headers along similar lines
* Fix whitespace in table header
Copy file name to clipboardExpand all lines: contributor-book/plugin_protocol_reference.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ The engine **may** send a [`Goodbye`](#goodbye) message to the plugin indicating
39
39
40
40
After the encoding type has been decided, both the engine and plugin **must** send a `Hello` message containing relevant version and protocol support information.
A successful response to a [`Metadata` plugin call](#metadata-plugin-call). The body contains fields that describe the plugin, none of which are required:
|**context**| integer | The ID of the [call](#call) that this engine call relates to. |
768
768
|**id**| integer | A unique ID for this engine call, in order to send the [response](#enginecallresponse). |
@@ -975,7 +975,7 @@ Example:
975
975
976
976
Pass a [`Closure`](#closure) and arguments to the engine to be evaluated. Returns a [`PipelineData` response](#pipelinedata-engine-call-response) if successful with the output of the closure, which may be a stream.
|**closure**| spanned [`Closure`](#closure)| The closure to call, generally from a [`Value`](#value). |
981
981
|**positional**|[`Value`](#value) array | Positional arguments for the closure. |
@@ -1048,7 +1048,7 @@ Example:
1048
1048
1049
1049
Pass a command's declaration ID (found via [`FindDecl`](#finddecl-engine-call)) and arguments to the engine to be called. Returns a [`PipelineData` response](#pipelinedata-engine-call-response) if successful with the output of the command, which may be a stream.
|**type**| string |**Must** be `"PluginCustomValue"`. |
2088
2088
|**name**| string | The human-readable name of the custom value emitted by the plugin. |
@@ -2138,7 +2138,7 @@ Structs are encoded as maps of their fields, without the name of the struct.
2138
2138
2139
2139
Describes a region of code in the engine's memory, used mostly for providing diagnostic error messages to the user with context about where a value that caused an error came from.
Copy file name to clipboardExpand all lines: contributor-book/plugins.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ impl SimplePluginCommand for Len {
90
90
"len"
91
91
}
92
92
93
-
fnusage(&self) ->&str {
93
+
fndescription(&self) ->&str {
94
94
"calculates the length of its input"
95
95
}
96
96
@@ -160,7 +160,7 @@ impl SimplePluginCommand for Len {
160
160
"len"
161
161
}
162
162
163
-
fnusage(&self) ->&str {
163
+
fndescription(&self) ->&str {
164
164
"calculates the length of its input"
165
165
}
166
166
@@ -173,7 +173,7 @@ impl SimplePluginCommand for Len {
173
173
}
174
174
```
175
175
176
-
There are a few methods required for this implementation. We first define the `name` of the command, which is what the user will type at the prompt or in their script to run the command. The `usage` is also required, which is a short documentation string for users to know what the command does, and is displayed along with completions and in `help`. Finally, we define the `signature`, which specifies arguments and types for the command.
176
+
There are a few methods required for this implementation. We first define the `name` of the command, which is what the user will type at the prompt or in their script to run the command. The `description` is also required, which is a short documentation string for users to know what the command does, and is displayed along with completions and in `help`. Finally, we define the `signature`, which specifies arguments and types for the command.
177
177
178
178
We tell Nu that the name is "len", give it a basic description for `help` to display and declare that we expect to be passed a string and will return an integer.
179
179
@@ -432,7 +432,7 @@ impl SimplePluginCommand for Motd {
432
432
"motd"
433
433
}
434
434
435
-
fnusage(&self) ->&str {
435
+
fndescription(&self) ->&str {
436
436
"Message of the day"
437
437
}
438
438
@@ -505,7 +505,7 @@ impl PluginCommand for MyEach {
{"CallResponse":[0, {"Signature":[{"sig":{"name":"len","usage":"calculates the length of its input","extra_usage":"","search_terms":[],"required_positional":[],"optional_positional":[],"rest_positional":null,"vectorizes_over_list":false,"named":[{"long":"help","short":"h","arg":null,"required":false,"desc":"Display the help message for this command","var_id":null,"default_value":null}],"input_type":"String","output_type":"Int","input_output_types":[],"allow_variants_without_examples":false,"is_filter":false,"creates_scope":false,"allows_unknown_args":false,"category":"Default"},"examples":[]}]}]}
902
+
{"CallResponse":[0, {"Signature":[{"sig":{"name":"len","description":"calculates the length of its input","extra_description":"","search_terms":[],"required_positional":[],"optional_positional":[],"rest_positional":null,"vectorizes_over_list":false,"named":[{"long":"help","short":"h","arg":null,"required":false,"desc":"Display the help message for this command","var_id":null,"default_value":null}],"input_type":"String","output_type":"Int","input_output_types":[],"allow_variants_without_examples":false,"is_filter":false,"creates_scope":false,"allows_unknown_args":false,"category":"Default"},"examples":[]}]}]}
903
903
```
904
904
905
905
The plugin prints its signature serialized as JSON. We'll reformat for readability.
@@ -910,8 +910,8 @@ The plugin prints its signature serialized as JSON. We'll reformat for readabili
910
910
{
911
911
"sig": {
912
912
"name": "len",
913
-
"usage": "calculates the length of its input",
914
-
"extra_usage": "",
913
+
"description": "calculates the length of its input",
914
+
"extra_description": "",
915
915
"search_terms": [],
916
916
"required_positional": [],
917
917
"optional_positional": [],
@@ -1020,8 +1020,8 @@ def signature():
1020
1020
return {
1021
1021
"sig": {
1022
1022
"name": "len",
1023
-
"usage": "calculates the length of its input",
1024
-
"extra_usage": "",
1023
+
"description": "calculates the length of its input",
0 commit comments