From 9c0649d2f8f974a4dbc59bfe566e825658eaf5db Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 11 Jan 2014 09:03:27 -0800 Subject: [PATCH] website/docs: document the plugin interface for non-primary commands --- .../docs/source/v2/plugins/commands.html.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/website/docs/source/v2/plugins/commands.html.md b/website/docs/source/v2/plugins/commands.html.md index f3a8ed86d..23cea5fcd 100644 --- a/website/docs/source/v2/plugins/commands.html.md +++ b/website/docs/source/v2/plugins/commands.html.md @@ -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