Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contributor-book/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl SimplePluginCommand for Len {
"len"
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"calculates the length of its input"
}

Expand Down Expand Up @@ -173,7 +173,7 @@ impl SimplePluginCommand for Len {
}
```

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.
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.

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.

Expand Down Expand Up @@ -432,7 +432,7 @@ impl SimplePluginCommand for Motd {
"motd"
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Message of the day"
}

Expand Down Expand Up @@ -505,7 +505,7 @@ impl PluginCommand for MyEach {
"my-each"
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Run closure on each element of a list"
}

Expand Down
Loading