website/docs: document the plugin interface for non-primary commands
This commit is contained in:
parent
13e9f8037a
commit
9c0649d2f8
|
@ -32,7 +32,23 @@ end
|
|||
Commands are defined with the `command` method, which takes as an argument
|
||||
the name of the command, in this case "foo." This means the command will be
|
||||
invokable via `vagrant foo`. Then the block argument returns a class that
|
||||
implements the `Vagrant.plugin(2, :command)` interface.
|
||||
implements the `Vagrant.plugin(2, "command")` interface.
|
||||
|
||||
You can also define _non-primary commands_. These commands do not show
|
||||
up in the `vagrant -h` output. They only show up if the user explicitly
|
||||
does a `vagrant help commands` which shows the full listing of available
|
||||
commands. This is useful for highly specific commands or plugins that a
|
||||
beginner to Vagrant would not be using anyways. Vagrant itself uses non-primary
|
||||
commands to expose some internal functions, as well.
|
||||
|
||||
To define a non-primary command:
|
||||
|
||||
```ruby
|
||||
command("foo", primary: false) do
|
||||
require_relative "command"
|
||||
Command
|
||||
end
|
||||
```
|
||||
|
||||
## Implementation
|
||||
|
||||
|
|
Loading…
Reference in New Issue